{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Approach\n\n1. Drop duplicate Image  and create stratify k-fold (I shall group same patients in one fold for avoid leaky)\n2. IN VERSION 2 I just try Yolov4 with Default hyperparams I try s m l x for 10 epochs and choose yolom as the best one \n   \n   score: (0.4947 + 0.5103 + 0.4848 +0.4692 +0.5198)/5 avg 0.49575   LB: 0.142\n\n3. IN VERSIOn 3 I just add more data augment and try yolox in 30 \n   \n   score: (0.481 + 0.488 + 0.525 + 0.525 + 0.488)\n   \n\n# Refference\n\n1. yolov5 github repo: source code, practice tips , TTA, training evolve https://github.com/ultralytics/yolov5/wiki/Tips-for-Best-Training-Results\n2. yolo hyperparams from VinBigData 15th https://www.kaggle.com/c/vinbigdata-chest-xray-abnormalities-detection/discussion/229649\n3. yolo hyperparam  from VinBigData 4th  https://www.kaggle.com/c/vinbigdata-chest-xray-abnormalities-detection/discussion/229786 \n\n# Furthur Improvments\n\n1. yolov5 p6 \n\n2. larger image size equal yolov5 default image size","metadata":{}},{"cell_type":"markdown","source":"# Download and Zip files \nin case kaggle dataset is slow with too much small files","metadata":{}},{"cell_type":"code","source":"%cd ../\n!mkdir /kaggle/tmp\n!mkdir /kaggle/tmp/mask\n!mkdir /kaggle/tmp/train\n!mkdir /kaggle/tmp/test\n%cd tmp","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:21.198454Z","iopub.execute_input":"2021-08-10T09:09:21.198910Z","iopub.status.idle":"2021-08-10T09:09:24.283073Z","shell.execute_reply.started":"2021-08-10T09:09:21.198825Z","shell.execute_reply":"2021-08-10T09:09:24.281867Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!tar -zxf /kaggle/input/siiim-covid-stratified-k-fold-and-create-mask/mask.tar.gz -C /kaggle/tmp/mask\n!tar -zxf /kaggle/input/siiim-covid-stratified-k-fold-and-create-mask/train.tar.gz -C /kaggle/tmp/train\n!tar -zxf /kaggle/input/siiim-covid-stratified-k-fold-and-create-mask/test.tar.gz -C /kaggle/tmp/test","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:24.287274Z","iopub.execute_input":"2021-08-10T09:09:24.287591Z","iopub.status.idle":"2021-08-10T09:09:40.579354Z","shell.execute_reply.started":"2021-08-10T09:09:24.287552Z","shell.execute_reply":"2021-08-10T09:09:40.577877Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Download YOLOv5\n!git clone https://github.com/ultralytics/yolov5  # clone repo\n%cd yolov5\n# Install dependencies\n%pip install -qr requirements.txt  # install dependencies","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:40.582170Z","iopub.execute_input":"2021-08-10T09:09:40.582598Z","iopub.status.idle":"2021-08-10T09:09:56.225305Z","shell.execute_reply.started":"2021-08-10T09:09:40.582551Z","shell.execute_reply":"2021-08-10T09:09:56.224022Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd ../","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:56.229293Z","iopub.execute_input":"2021-08-10T09:09:56.229666Z","iopub.status.idle":"2021-08-10T09:09:56.241924Z","shell.execute_reply.started":"2021-08-10T09:09:56.229630Z","shell.execute_reply":"2021-08-10T09:09:56.240625Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Install W&B \n#!pip install -q --upgrade wandb\n# Login \n#import wandb\n#wandb.login()","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:56.245612Z","iopub.execute_input":"2021-08-10T09:09:56.245946Z","iopub.status.idle":"2021-08-10T09:09:56.251200Z","shell.execute_reply.started":"2021-08-10T09:09:56.245913Z","shell.execute_reply":"2021-08-10T09:09:56.249981Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import torch\nimport os\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nfrom shutil import copyfile\nimport matplotlib.pyplot as plt\n\nimport csv","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:56.253120Z","iopub.execute_input":"2021-08-10T09:09:56.253679Z","iopub.status.idle":"2021-08-10T09:09:57.910460Z","shell.execute_reply.started":"2021-08-10T09:09:56.253631Z","shell.execute_reply":"2021-08-10T09:09:57.909344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"study_df = pd.read_csv(\"/kaggle/input/siim-covid19-detection/train_study_level.csv\")\nimage_df = pd.read_csv(\"/kaggle/input/siim-covid19-detection/train_image_level.csv\")\nmeta_df = pd.read_csv(\"/kaggle/input/siiim-covid-stratified-k-fold-and-create-mask/meta.csv\")\nfold_df = pd.read_csv(\"/kaggle/input/siiim-covid-stratified-k-fold-and-create-mask/updated_iamge_level.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:57.912129Z","iopub.execute_input":"2021-08-10T09:09:57.912621Z","iopub.status.idle":"2021-08-10T09:09:58.030100Z","shell.execute_reply.started":"2021-08-10T09:09:57.912563Z","shell.execute_reply":"2021-08-10T09:09:58.029100Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"_duplicateList_path = '/kaggle/input/siiim-covid-stratified-k-fold-and-create-mask/dublicate.txt'","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.033989Z","iopub.execute_input":"2021-08-10T09:09:58.034438Z","iopub.status.idle":"2021-08-10T09:09:58.041642Z","shell.execute_reply.started":"2021-08-10T09:09:58.034396Z","shell.execute_reply":"2021-08-10T09:09:58.040520Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"_duplicateList = []\nwith open(_duplicateList_path, newline='') as csvfile:\n    spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n    for row in spamreader:\n        _duplicateList += row\n\n_duplicateList[:5]","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.044384Z","iopub.execute_input":"2021-08-10T09:09:58.045026Z","iopub.status.idle":"2021-08-10T09:09:58.060799Z","shell.execute_reply.started":"2021-08-10T09:09:58.044966Z","shell.execute_reply":"2021-08-10T09:09:58.059428Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"TRAIN_PATH = '/kaggle/tmp/train/'\nIMG_SIZE = 512\nBATCH_SIZE = 24\nEPOCHS = 30","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.062731Z","iopub.execute_input":"2021-08-10T09:09:58.063209Z","iopub.status.idle":"2021-08-10T09:09:58.069421Z","shell.execute_reply.started":"2021-08-10T09:09:58.063165Z","shell.execute_reply":"2021-08-10T09:09:58.068101Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Modify values in the id column\ndf = fold_df.copy()\n\ndf['id'] = df.apply(lambda row: row.id.split('_')[0], axis=1)\n# Add absolute path\ndf['path'] = df.apply(lambda row: TRAIN_PATH+row.id+'.png', axis=1)\n# Get image level labels\ndf['image_level'] = df.apply(lambda row: row.label.split(' ')[0], axis=1)\n\ndf.head(5)","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.071399Z","iopub.execute_input":"2021-08-10T09:09:58.072298Z","iopub.status.idle":"2021-08-10T09:09:58.454610Z","shell.execute_reply.started":"2021-08-10T09:09:58.072250Z","shell.execute_reply":"2021-08-10T09:09:58.453473Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"meta_df.head()","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.456513Z","iopub.execute_input":"2021-08-10T09:09:58.457053Z","iopub.status.idle":"2021-08-10T09:09:58.471053Z","shell.execute_reply.started":"2021-08-10T09:09:58.456965Z","shell.execute_reply":"2021-08-10T09:09:58.469496Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = df.merge(meta_df, left_on='id', right_on=\"image_id\")\ndf.head(2)","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.473399Z","iopub.execute_input":"2021-08-10T09:09:58.474066Z","iopub.status.idle":"2021-08-10T09:09:58.511742Z","shell.execute_reply.started":"2021-08-10T09:09:58.474021Z","shell.execute_reply":"2021-08-10T09:09:58.510440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"before drop duplicate\", len(df))\ndf = df[~df['id'].isin(_duplicateList)]\nprint(\"after drop duplicate\", len(df))","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.513600Z","iopub.execute_input":"2021-08-10T09:09:58.514038Z","iopub.status.idle":"2021-08-10T09:09:58.530180Z","shell.execute_reply.started":"2021-08-10T09:09:58.513996Z","shell.execute_reply":"2021-08-10T09:09:58.528529Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Split train valid and create 5fold ","metadata":{}},{"cell_type":"code","source":"os.makedirs('tmp/covid/images/train', exist_ok=True)\nos.makedirs('tmp/covid/images/valid', exist_ok=True)\n\nos.makedirs('tmp/covid/labels/train', exist_ok=True)\nos.makedirs('tmp/covid/labels/valid', exist_ok=True)","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.532506Z","iopub.execute_input":"2021-08-10T09:09:58.532967Z","iopub.status.idle":"2021-08-10T09:09:58.541777Z","shell.execute_reply.started":"2021-08-10T09:09:58.532923Z","shell.execute_reply":"2021-08-10T09:09:58.540305Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.543857Z","iopub.execute_input":"2021-08-10T09:09:58.544601Z","iopub.status.idle":"2021-08-10T09:09:58.573898Z","shell.execute_reply.started":"2021-08-10T09:09:58.544553Z","shell.execute_reply":"2021-08-10T09:09:58.572583Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Move the images to relevant split folder.\n# 5 fold\nfor _fold in range(5):\n    os.makedirs(f'/kaggle/tmp/covid/images/train/fold{_fold}', exist_ok=True)\n    os.makedirs(f'/kaggle/tmp/covid/images/valid/fold{_fold}', exist_ok=True)\n\n    for i in tqdm(range(len(df))):\n        row = df.iloc[i]\n        if row.fold != _fold:\n            copyfile(row.path, f'/kaggle/tmp/covid/images/train/fold{_fold}/{row.id}.png')\n        else:\n            copyfile(row.path, f'/kaggle/tmp/covid/images/valid/fold{_fold}/{row.id}.png')","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:09:58.575495Z","iopub.execute_input":"2021-08-10T09:09:58.576393Z","iopub.status.idle":"2021-08-10T09:10:23.592641Z","shell.execute_reply.started":"2021-08-10T09:09:58.576177Z","shell.execute_reply":"2021-08-10T09:10:23.591221Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls /kaggle/tmp/covid/images/train/fold0/ | wc -l","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:23.595244Z","iopub.execute_input":"2021-08-10T09:10:23.595762Z","iopub.status.idle":"2021-08-10T09:10:24.569718Z","shell.execute_reply.started":"2021-08-10T09:10:23.595715Z","shell.execute_reply":"2021-08-10T09:10:24.568355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Get the raw bounding box by parsing the row value of the label column.\n# Ref: https://www.kaggle.com/yujiariyasu/plot-3positive-classes\ndef get_bbox(row):\n    bboxes = []\n    bbox = []\n    for i, l in enumerate(row.label.split(' ')):\n        if (i % 6 == 0) | (i % 6 == 1):\n            continue\n        bbox.append(float(l))\n        if i % 6 == 5:\n            bboxes.append(bbox)\n            bbox = []  \n            \n    return bboxes\n\n# Scale the bounding boxes according to the size of the resized image. \ndef scale_bbox(row, bboxes):\n    # Get scaling factor\n    scale_x = IMG_SIZE/row.dim1\n    scale_y = IMG_SIZE/row.dim0\n    \n    scaled_bboxes = []\n    for bbox in bboxes:\n        x = int(np.round(bbox[0]*scale_x, 4))\n        y = int(np.round(bbox[1]*scale_y, 4))\n        x1 = int(np.round(bbox[2]*(scale_x), 4))\n        y1= int(np.round(bbox[3]*scale_y, 4))\n\n        scaled_bboxes.append([x, y, x1, y1]) # xmin, ymin, xmax, ymax\n        \n    return scaled_bboxes\n\n# Convert the bounding boxes in YOLO format.\ndef get_yolo_format_bbox(img_w, img_h, bboxes):\n    yolo_boxes = []\n    for bbox in bboxes:\n        w = bbox[2] - bbox[0] # xmax - xmin\n        h = bbox[3] - bbox[1] # ymax - ymin\n        xc = bbox[0] + int(np.round(w/2)) # xmin + width/2\n        yc = bbox[1] + int(np.round(h/2)) # ymin + height/2\n        \n        yolo_boxes.append([xc/img_w, yc/img_h, w/img_w, h/img_h]) # x_center y_center width height\n    \n    return yolo_boxes","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:24.573587Z","iopub.execute_input":"2021-08-10T09:10:24.574000Z","iopub.status.idle":"2021-08-10T09:10:30.228586Z","shell.execute_reply.started":"2021-08-10T09:10:24.573966Z","shell.execute_reply":"2021-08-10T09:10:30.227192Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Prepare the txt files for bounding box\nfor _fold in range(5):\n    os.makedirs(f'/kaggle/tmp/covid/labels/train/fold{_fold}', exist_ok=True)\n    os.makedirs(f'/kaggle/tmp/covid/labels/valid/fold{_fold}', exist_ok=True)\n    \n    for i in tqdm(range(len(df))):\n        row = df.iloc[i]\n        # Get image id\n        img_id = row.id\n        # Get split\n        split = row.split\n        # Get image-level label\n        label = row.image_level\n\n        if row.fold != _fold:\n            file_name = f'/kaggle/tmp/covid/labels/train/fold{_fold}/{row.id}.txt'\n        else:\n            file_name = f'/kaggle/tmp/covid/labels/valid/fold{_fold}/{row.id}.txt'\n        \n        if label=='opacity':\n            # Get bboxes\n            bboxes = get_bbox(row)\n            # Scale bounding boxes\n            scale_bboxes = scale_bbox(row, bboxes)\n            # Format for YOLOv5\n            yolo_bboxes = get_yolo_format_bbox(IMG_SIZE, IMG_SIZE, scale_bboxes)\n\n            with open(file_name, 'w') as f:\n                for bbox in yolo_bboxes:\n                    bbox = [1]+bbox\n                    bbox = [str(i) for i in bbox]\n                    bbox = ' '.join(bbox)\n                    f.write(bbox)\n                    f.write('\\n')","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:30.230298Z","iopub.execute_input":"2021-08-10T09:10:30.230725Z","iopub.status.idle":"2021-08-10T09:10:50.880614Z","shell.execute_reply.started":"2021-08-10T09:10:30.230679Z","shell.execute_reply":"2021-08-10T09:10:50.879462Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cat /kaggle/tmp/covid/labels/valid/fold0/0012ff7358bc.txt","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:50.885191Z","iopub.execute_input":"2021-08-10T09:10:50.887951Z","iopub.status.idle":"2021-08-10T09:10:51.781295Z","shell.execute_reply.started":"2021-08-10T09:10:50.887904Z","shell.execute_reply":"2021-08-10T09:10:51.780069Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls /kaggle/tmp/covid/labels/valid/fold1 | wc -l","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:51.785273Z","iopub.execute_input":"2021-08-10T09:10:51.785619Z","iopub.status.idle":"2021-08-10T09:10:53.198890Z","shell.execute_reply.started":"2021-08-10T09:10:51.785584Z","shell.execute_reply":"2021-08-10T09:10:53.197600Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd yolov5","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:53.204449Z","iopub.execute_input":"2021-08-10T09:10:53.204744Z","iopub.status.idle":"2021-08-10T09:10:53.212289Z","shell.execute_reply.started":"2021-08-10T09:10:53.204712Z","shell.execute_reply":"2021-08-10T09:10:53.210737Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create .yaml file \nimport yaml\nfor _fold in range(5):\n    data_yaml = dict(\n        train = f'../covid/images/train/fold{_fold}',\n        val = f'../covid/images/valid/fold{_fold}',\n        nc = 2,\n        names = ['none', 'opacity']\n    )\n\n    # Note that I am creating the file in the yolov5/data/ directory.\n    with open(f'data/data-fold{_fold}.yaml', 'w') as outfile:\n        yaml.dump(data_yaml, outfile, default_flow_style=True)\n    \n%cat data/data-fold0.yaml\n%cat data/data-fold1.yaml\n%cat data/data-fold2.yaml\n%cat data/data-fold3.yaml\n%cat data/data-fold4.yaml","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:53.214377Z","iopub.execute_input":"2021-08-10T09:10:53.215548Z","iopub.status.idle":"2021-08-10T09:10:57.307656Z","shell.execute_reply.started":"2021-08-10T09:10:53.215498Z","shell.execute_reply":"2021-08-10T09:10:57.306309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls /kaggle/tmp/covid/labels/valid/fold0 | wc -l","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:57.309711Z","iopub.execute_input":"2021-08-10T09:10:57.310217Z","iopub.status.idle":"2021-08-10T09:10:58.092688Z","shell.execute_reply.started":"2021-08-10T09:10:57.310169Z","shell.execute_reply":"2021-08-10T09:10:58.091484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Hyperparams","metadata":{}},{"cell_type":"code","source":"\"\"\"\n lr0: 0.01  # initial learning rate (SGD=1E-2, Adam=1E-3) \n lrf: 0.2  # final OneCycleLR learning rate (lr0 * lrf) \n momentum: 0.937  # SGD momentum/Adam beta1 \n weight_decay: 0.0005  # optimizer weight decay 5e-4 \n warmup_epochs: 3.0  # warmup epochs (fractions ok) \n warmup_momentum: 0.8  # warmup initial momentum \n warmup_bias_lr: 0.1  # warmup initial bias lr \n box: 0.05  # box loss gain \n cls: 0.5  # cls loss gain \n cls_pw: 1.0  # cls BCELoss positive_weight \n obj: 1.0  # obj loss gain (scale with pixels) \n obj_pw: 1.0  # obj BCELoss positive_weight \n iou_t: 0.20  # IoU training threshold \n anchor_t: 4.0  # anchor-multiple threshold \n # anchors: 3  # anchors per output layer (0 to ignore) \n fl_gamma: 0.0  # focal loss gamma (efficientDet default gamma=1.5) \n hsv_h: 0.015  # image HSV-Hue augmentation (fraction) \n hsv_s: 0.7  # image HSV-Saturation augmentation (fraction) \n hsv_v: 0.4  # image HSV-Value augmentation (fraction) \n degrees: 0.0  # image rotation (+/- deg) \n translate: 0.1  # image translation (+/- fraction) \n scale: 0.5  # image scale (+/- gain) \n shear: 0.0  # image shear (+/- deg) \n perspective: 0.0  # image perspective (+/- fraction), range 0-0.001 \n flipud: 0.0  # image flip up-down (probability) \n fliplr: 0.5  # image flip left-right (probability) \n mosaic: 1.0  # image mosaic (probability) \n mixup: 0.0  # image mixup (probability) \n copy_paste: 0.0  # segment copy-paste (probability) \n\"\"\"\n\nhyps_yaml = dict(\n    lr0= 0.01,\n    lrf= 0.2,\n    momentum= 0.937,\n    weight_decay= 0.0005,\n    warmup_epochs= 3.0,\n    warmup_momentum= 0.8,\n    warmup_bias_lr= 0.1,\n    box= 0.05,\n    cls= 0.5,\n    cls_pw= 1,\n    obj= 1,\n    obj_pw= 1,\n    iou_t= 0.2,\n    anchor_t= 4,\n    # anchors: 3.63,\n    fl_gamma= 0.0,\n    hsv_h= 0.015,\n    hsv_s= 0.7,\n    hsv_v= 0.4,\n    degrees= 0.3,\n    translate= 0.1,\n    scale= 0.6,\n    shear= 0.1,\n    perspective= 0.0,\n    flipud= 0,\n    fliplr= 0.5,\n    mosaic= 1,\n    mixup= 0,\n    copy_paste= 0.0\n)\n\n# Note that I am creating the file in the yolov5/data/ directory.\nwith open(f'data/hyps-custom.yaml', 'w') as outfile:\n    yaml.dump(hyps_yaml, outfile, default_flow_style=True)","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:10:58.094243Z","iopub.execute_input":"2021-08-10T09:10:58.094575Z","iopub.status.idle":"2021-08-10T09:10:58.111267Z","shell.execute_reply.started":"2021-08-10T09:10:58.094543Z","shell.execute_reply":"2021-08-10T09:10:58.109995Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!wandb offline","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:15:41.622567Z","iopub.execute_input":"2021-08-10T09:15:41.623058Z","iopub.status.idle":"2021-08-10T09:15:43.789703Z","shell.execute_reply.started":"2021-08-10T09:15:41.623021Z","shell.execute_reply":"2021-08-10T09:15:43.788494Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!python train.py --img {IMG_SIZE} \\\n                 --batch {BATCH_SIZE} \\\n                 --epochs {EPOCHS} \\\n                 --data data-fold0.yaml \\\n                 --weights yolov5x.pt \\\n                 --save_period 1\\\n                 --hyp /kaggle/tmp/yolov5/data/hyps-custom.yaml \\\n                 --project /kaggle/working/kaggle-siim-covid","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:15:45.198409Z","iopub.execute_input":"2021-08-10T09:15:45.198809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls /kaggle/working/kaggle-siim-covid","metadata":{"execution":{"iopub.status.busy":"2021-08-10T09:15:13.500850Z","iopub.execute_input":"2021-08-10T09:15:13.501351Z","iopub.status.idle":"2021-08-10T09:15:14.269254Z","shell.execute_reply.started":"2021-08-10T09:15:13.501302Z","shell.execute_reply":"2021-08-10T09:15:14.267963Z"},"trusted":true},"execution_count":null,"outputs":[]}]}