{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[{"sourceId":67836,"databundleVersionId":7527339,"sourceType":"competition"},{"sourceId":7615416,"sourceType":"datasetVersion","datasetId":4434978},{"sourceId":7615531,"sourceType":"datasetVersion","datasetId":4433474}],"dockerImageVersionId":30648,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# The training is done in our personal gpu on CLI","metadata":{}},{"cell_type":"markdown","source":"### The training is performed into two steps. On our first step, we have trained the pretrained yolov8x model on the dataset provided by the authority for 45 epochs with the batch size of 64. And then, we have made an augmented dataset from the provided dataset and trained the model acquired from the first step on the new dataset for 25 epochs with the batch size of 64. Inference is done with the output model of second step","metadata":{}},{"cell_type":"markdown","source":"# First step","metadata":{}},{"cell_type":"code","source":"# Clone the ultralytics repository\n! git clone https://github.com/ultralytics/ultralytics","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-02-13T05:33:22.891859Z","iopub.execute_input":"2024-02-13T05:33:22.892622Z","iopub.status.idle":"2024-02-13T05:33:26.003861Z","shell.execute_reply.started":"2024-02-13T05:33:22.892589Z","shell.execute_reply":"2024-02-13T05:33:26.002769Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ls","metadata":{"execution":{"iopub.status.busy":"2024-02-13T05:33:28.55908Z","iopub.execute_input":"2024-02-13T05:33:28.559896Z","iopub.status.idle":"2024-02-13T05:33:29.511109Z","shell.execute_reply.started":"2024-02-13T05:33:28.55986Z","shell.execute_reply":"2024-02-13T05:33:29.510169Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cd ultralytics/","metadata":{"execution":{"iopub.status.busy":"2024-02-13T05:33:29.512849Z","iopub.execute_input":"2024-02-13T05:33:29.513144Z","iopub.status.idle":"2024-02-13T05:33:29.519462Z","shell.execute_reply.started":"2024-02-13T05:33:29.513118Z","shell.execute_reply":"2024-02-13T05:33:29.518523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! pip install -e .","metadata":{"execution":{"iopub.status.busy":"2024-02-13T05:33:30.105086Z","iopub.execute_input":"2024-02-13T05:33:30.105737Z","iopub.status.idle":"2024-02-13T05:33:57.281589Z","shell.execute_reply.started":"2024-02-13T05:33:30.105705Z","shell.execute_reply":"2024-02-13T05:33:57.280604Z"},"_kg_hide-output":true,"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! export MKL_SERVICE_FORCE_INTEL=1","metadata":{"execution":{"iopub.status.busy":"2024-02-13T05:34:01.562893Z","iopub.execute_input":"2024-02-13T05:34:01.563382Z","iopub.status.idle":"2024-02-13T05:34:02.548259Z","shell.execute_reply.started":"2024-02-13T05:34:01.563348Z","shell.execute_reply":"2024-02-13T05:34:02.54707Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! yolo detect train data=/kaggle/input/journey-by-neuron-modelckpt/badodd_first_step.yaml model=yolov8x.pt epochs=45 imgsz=640 batch=64 device=0 pretrained=True optimizer=AdamW seed=0 lr0=1e-3 weight_decay=1e-4 val=False plots=True","metadata":{"execution":{"iopub.status.busy":"2024-02-13T05:34:02.550292Z","iopub.execute_input":"2024-02-13T05:34:02.550611Z","iopub.status.idle":"2024-02-13T05:34:39.777325Z","shell.execute_reply.started":"2024-02-13T05:34:02.550583Z","shell.execute_reply":"2024-02-13T05:34:39.776268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## The output model ckpt is \"/kaggle/input/journey-by-neuron-modelckpt/best_first_step.pt\"","metadata":{}},{"cell_type":"markdown","source":"# Second step","metadata":{}},{"cell_type":"code","source":"! yolo detect train data=/kaggle/input/journey-by-neuron-modelckpt/badodd_second_step.yaml model=/kaggle/input/journey-by-neuron-modelckpt/best_first_step.pt epochs=25 imgsz=640 batch=64 device=0 pretrained=True optimizer=AdamW seed=0 lr0=1e-3 weight_decay=1e-4 val=True plots=True","metadata":{"execution":{"iopub.status.busy":"2024-02-13T05:34:46.986922Z","iopub.execute_input":"2024-02-13T05:34:46.987587Z","iopub.status.idle":"2024-02-13T05:35:15.380639Z","shell.execute_reply.started":"2024-02-13T05:34:46.987549Z","shell.execute_reply":"2024-02-13T05:35:15.379468Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## The output model ckpt is \"/kaggle/input/journey-by-neuron-modelckpt/best_second_step.pt\"","metadata":{}}]}