{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":123966,"databundleVersionId":14902028,"sourceType":"competition"},{"sourceId":14682667,"sourceType":"datasetVersion","datasetId":9379891}],"dockerImageVersionId":31260,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install ultralytics","metadata":{"trusted":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2026-01-31T00:02:50.495078Z","iopub.execute_input":"2026-01-31T00:02:50.495609Z","iopub.status.idle":"2026-01-31T00:02:58.370185Z","shell.execute_reply.started":"2026-01-31T00:02:50.495578Z","shell.execute_reply":"2026-01-31T00:02:58.369385Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import yaml\n\nyaml_path = \"/kaggle/input/syntheticdatasetdetection/yolo_dataset/data.yaml\"\n\nwith open(yaml_path, 'r') as f:\n    config = yaml.safe_load(f)\n\nnew_path = \"/kaggle/input/syntheticdatasetdetection/yolo_dataset\"\nconfig['path'] = new_path\n\nYAML = 'yolo.yaml'\n\nwith open(YAML, 'w') as f:\n    yaml.dump(config, f, default_flow_style=False, sort_keys=False)","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-01-31T00:02:58.372287Z","iopub.execute_input":"2026-01-31T00:02:58.372651Z","iopub.status.idle":"2026-01-31T00:02:58.411908Z","shell.execute_reply.started":"2026-01-31T00:02:58.372597Z","shell.execute_reply":"2026-01-31T00:02:58.411039Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from ultralytics import YOLO\n\nmodel = YOLO(\"yolo11n.pt\")\n\nmodel.train(\n    data=YAML,\n    epochs=52,\n    batch=4,\n    imgsz=1280,\n    device=[0,1],\n    patience=15,\n    optimizer='SGD',\n    lr0=0.0005,\n    lrf = 0.0001,\n    weight_decay=0.0006,\n    cos_lr=True,\n    workers=8,\n    dropout=0.3,\n    label_smoothing=0.1,\n    # Augmentations\n    close_mosaic=10,\n    hsv_h=0.015,\n    hsv_s=0.01,\n    hsv_v=0.05,\n    flipud=0.3,\n    fliplr=0.5,\n    translate=0.05,\n    erasing = 0.5,\n    scale=0.4,\n    project = 'runs/train',\n    seed=42\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-31T00:02:58.413061Z","iopub.execute_input":"2026-01-31T00:02:58.413373Z","execution_failed":"2026-01-31T00:06:49.271Z"}},"outputs":[],"execution_count":null}]}