{"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":"## Amaç \nAkciğer görüntüleri verilen  veri setini YoloV5 modeli kullanılarak transfer öğrenme yardımıyla virüsün hangi bölgede olduğunun işaretlenmesi yapay zeka ile yapıalcaktır.\n\n\n## 🖼️ YoloV5 NEDİR ?\nYoloV5 algoritması nesneleri kutucuk içerisine alarak koordinatlarını ve sınfını döndüren bir nesne tespit algoritmasıdır. Coco dataseti ile eğitilmiştir. Doğruluğunun ve performansının yüksek olması sebebiyle tercih ettim.\n \n\nAşamalar:\n\n✔️ Gerekli dosya yapısını oluştur <br>\n✔️ Bounding box (kutucukları) yolov5 için uygun formata getir   <br>\n✔️ Hafif bir YoloV5 modeliyle eğitim yap <br>\n✔️ Sonnuçları incele <br>\n✔️ Test görüntülerine bak ve  görselleştir <br>","metadata":{}},{"cell_type":"markdown","source":"# ☀️ İmportlar ve kurulum\n\nYoloV5 dosya yapısına göre mimari aşağıdaki gibi olmalıdır. \n\n```\n/parent_folder\n    /dataset\n         /images\n         /labels\n    /yolov5\n```\n\n* /temp dizini oluşturacağız <br>\n* YoloV5 indirilip gerekli bağımlılıklar kurulacak <br>","metadata":{}},{"cell_type":"code","source":"!pip install wandb","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:20:42.342170Z","iopub.execute_input":"2022-01-06T16:20:42.342653Z","iopub.status.idle":"2022-01-06T16:20:50.508078Z","shell.execute_reply.started":"2022-01-06T16:20:42.342605Z","shell.execute_reply":"2022-01-06T16:20:50.506745Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import wandb\nwandb.login()","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:20:50.510566Z","iopub.execute_input":"2022-01-06T16:20:50.511024Z","iopub.status.idle":"2022-01-06T16:21:26.629394Z","shell.execute_reply.started":"2022-01-06T16:20:50.510971Z","shell.execute_reply":"2022-01-06T16:21:26.628124Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle\n! mkdir tmp\n%cd tmp","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:26.632401Z","iopub.execute_input":"2022-01-06T16:21:26.632859Z","iopub.status.idle":"2022-01-06T16:21:27.413868Z","shell.execute_reply.started":"2022-01-06T16:21:26.632792Z","shell.execute_reply":"2022-01-06T16:21:27.412569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#  YOLOv5 modelini indir\n!git clone https://github.com/ultralytics/yolov5  # clone repo\n%cd yolov5\n# Bağımlılıkların yüklenmesi\n%pip install -qr requirements.txt \n\n%cd ../\nimport torch\nprint(f\"Setup complete. Using torch {torch.__version__} ({torch.cuda.get_device_properties(0).name if torch.cuda.is_available() else 'CPU'})\")","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:27.416473Z","iopub.execute_input":"2022-01-06T16:21:27.416942Z","iopub.status.idle":"2022-01-06T16:21:35.739321Z","shell.execute_reply.started":"2022-01-06T16:21:27.416890Z","shell.execute_reply":"2022-01-06T16:21:35.738119Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# kütüphanlerin içe aktarılması\nimport os\nimport gc\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nfrom shutil import copyfile\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n\nfrom IPython.core.magic import register_line_cell_magic\n\n@register_line_cell_magic\ndef writetemplate(line, cell):\n    with open(line, 'w') as f:\n        f.write(cell.format(**globals()))","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:35.741660Z","iopub.execute_input":"2022-01-06T16:21:35.742158Z","iopub.status.idle":"2022-01-06T16:21:35.751680Z","shell.execute_reply.started":"2022-01-06T16:21:35.742108Z","shell.execute_reply":"2022-01-06T16:21:35.750220Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Sabitlerin tanımlanması","metadata":{}},{"cell_type":"code","source":"# eğitim görüntü yolu\nTRAIN_PATH = 'input/siim-covid19-resized-to-256px-jpg/train/'\n# resimlerin gelmesi gerekn boyut\nIMG_SIZE = 256\n# her seferinde çekilecek sayısı\nBATCH_SIZE = 16\n# kaç sefer veriler verilecek\nEPOCHS = 35","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:35.753664Z","iopub.execute_input":"2022-01-06T16:21:35.754211Z","iopub.status.idle":"2022-01-06T16:21:35.765779Z","shell.execute_reply.started":"2022-01-06T16:21:35.754164Z","shell.execute_reply":"2022-01-06T16:21:35.764674Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## 🔨 Veri Setinin Hazırlanması ¶ \nYoloV5 nesne tepsiti için önemli bölümdür. Dizin yapısı ve bounding box (kare kutu) YoloV5 modelini eğitmek için uygun formatta olmalıdır\n\nBen veri setini  yeniden boyutlandırarak kullanıyorum. Resimlerin boyutunu 256x256 formatına getiriyorum.\n\n<ol>\n    <li> train-validation ( eğitim-doğrulama ) bölmesi </li> \n        <li> Gerekli /dataset klasör yapısını ve klasörlerdeki görüntüleri yarat </li>  \n        <li> Gerekli /dataset klasör yapısını ve klasörlerdeki görüntüleri yarat </li>  \n        <li> YoloV5 modelini eğitmek için data.yaml dosyasını oluştur </li>  \n            <li> YoloV5 formatı için  bounding box (kare kutucukları) yarat </li>  \n\n\n</ol>","metadata":{}},{"cell_type":"code","source":"# Herşey /kaggle dizininden\n%cd ../\n# resimlerin csv formattaki dosyasını al\ndf = pd.read_csv('input/siim-covid19-detection/train_image_level.csv')\n\n# id sütunundaki değerleri değiştir\ndf['id'] = df.apply(lambda row: row.id.split('_')[0], axis=1)\n# Kesin yolu ekle\ndf['path'] = df.apply(lambda row: TRAIN_PATH+row.id+'.jpg', axis=1)\n# Resimlerin image_level değerlerini al\ndf['image_level'] = df.apply(lambda row: row.label.split(' ')[0], axis=1)\n\ndf.head(5)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:35.767820Z","iopub.execute_input":"2022-01-06T16:21:35.768455Z","iopub.status.idle":"2022-01-06T16:21:36.172676Z","shell.execute_reply.started":"2022-01-06T16:21:35.768410Z","shell.execute_reply":"2022-01-06T16:21:36.170511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# meta.csv dosyasını yükle\n# Orjinal boyutların bounding box formatı için yeniden scale (ölçeklendirilmesi) gerekmektedir\nmeta_df = pd.read_csv('input/siim-covid19-resized-to-256px-jpg/meta.csv')\ntrain_meta_df = meta_df.loc[meta_df.split == 'train']\ntrain_meta_df = train_meta_df.drop('split', axis=1)\ntrain_meta_df.columns = ['id', 'dim0', 'dim1']\n\ntrain_meta_df.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:36.174325Z","iopub.execute_input":"2022-01-06T16:21:36.174783Z","iopub.status.idle":"2022-01-06T16:21:36.205293Z","shell.execute_reply.started":"2022-01-06T16:21:36.174737Z","shell.execute_reply":"2022-01-06T16:21:36.204148Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Her iki dataframe'i  birleştirme\ndf = df.merge(train_meta_df, on='id',how=\"left\")\ndf.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:36.209412Z","iopub.execute_input":"2022-01-06T16:21:36.209736Z","iopub.status.idle":"2022-01-06T16:21:36.236560Z","shell.execute_reply.started":"2022-01-06T16:21:36.209705Z","shell.execute_reply":"2022-01-06T16:21:36.235405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### 🍘 Eğitim-doğrulama bölmesi","metadata":{}},{"cell_type":"code","source":"train_df, valid_df = train_test_split(df, test_size=0.2, random_state=42, stratify=df.image_level.values)\n\ntrain_df.loc[:, 'split'] = 'train'\nvalid_df.loc[:, 'split'] = 'valid'\n\ndf = pd.concat([train_df, valid_df]).reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:36.238889Z","iopub.execute_input":"2022-01-06T16:21:36.239670Z","iopub.status.idle":"2022-01-06T16:21:36.273433Z","shell.execute_reply.started":"2022-01-06T16:21:36.239609Z","shell.execute_reply":"2022-01-06T16:21:36.272144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(f'Veri seti boyutu: {len(df)}, Eğitim görüntüleri: {len(train_df)}. Doğrulama görüntüleri: {len(valid_df)}')","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:36.275269Z","iopub.execute_input":"2022-01-06T16:21:36.276155Z","iopub.status.idle":"2022-01-06T16:21:36.283824Z","shell.execute_reply.started":"2022-01-06T16:21:36.276084Z","shell.execute_reply":"2022-01-06T16:21:36.282388Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## 🍚 Prepare Required Folder Structure\nModel için gerekli olan veri seti dosya yapısı aşağıdaki gibidir:\n<br>\n``` \n/parent_folder\n    /dataset\n         /images\n             /train\n             /val\n         /labels\n             /train\n             /val\n    /yolov5\n```\n\nYolu covid olarak isimnlendirdim","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)\n\n! ls tmp/covid/images","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:36.285766Z","iopub.execute_input":"2022-01-06T16:21:36.286527Z","iopub.status.idle":"2022-01-06T16:21:37.062447Z","shell.execute_reply.started":"2022-01-06T16:21:36.286472Z","shell.execute_reply":"2022-01-06T16:21:37.061199Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Eğitim ve doğrulama görüntülerini tutacağım klasörleri oluşturdum (train-valid). <br>\nAynı zamanda etiklleri ve bounding box bbilgilerini tutmak için ayrı bir olark klasör oluşturdum","metadata":{}},{"cell_type":"code","source":"for i in tqdm(range(len(df))):\n    row = df.loc[i]\n    if row.split == 'train':\n        copyfile(row.path, f'tmp/covid/images/train/{row.id}.jpg')\n    else:\n        copyfile(row.path, f'tmp/covid/images/valid/{row.id}.jpg')","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:37.065681Z","iopub.execute_input":"2022-01-06T16:21:37.066403Z","iopub.status.idle":"2022-01-06T16:21:45.929941Z","shell.execute_reply.started":"2022-01-06T16:21:37.066348Z","shell.execute_reply":"2022-01-06T16:21:45.928706Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Görüntüleri kopyalayıp yeni dizinlere yapıştırdım","metadata":{}},{"cell_type":"markdown","source":"# Create .YAML file\ndata.yaml,  veri seti yapılandırma dosyasıdır.\n1. otomatik indirme için bir \"isteğe bağlı\" indirme komutu/URL'si\n2. eğitim görüntüleri klasörünün yolu (veya eğitim görüntülerinin listesini içeren bir *.txt dosyasının yolu)\n3. doğrulama görüntüleri dizininin yolu (veya doğrulama görüntülerinin listesini içeren bir *.txt dosyasının yolu)\n4. sınıf sayısı\n5. sınıf isimleri listesi","metadata":{}},{"cell_type":"code","source":"#.yaml dosyası oluştur\nimport yaml\n\ndata_yaml = dict(\n    train = '../covid/images/train',\n    val = '../covid/images/valid',\n    nc = 2,\n    names = ['none', 'opacity']\n)\n\n# Dosyayı yolov5/data/ klasöründe  oluşturma\nwith open('tmp/yolov5/data/data.yaml', 'w') as outfile:\n    yaml.dump(data_yaml, outfile, default_flow_style=True)\n    \n%cat tmp/yolov5/data/data.yaml","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:45.931719Z","iopub.execute_input":"2022-01-06T16:21:45.932198Z","iopub.status.idle":"2022-01-06T16:21:46.716382Z","shell.execute_reply.started":"2022-01-06T16:21:45.932162Z","shell.execute_reply":"2022-01-06T16:21:46.715003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"> **YOLOv5 için Koordineli Sınırlama Kutusu Hazırlayın\n\nSınırlayıcı kutuya/kutulara sahip her görüntü için, aşağıda gösterilen biçimde görüntüyle aynı ada sahip bir .txt dosyası oluşturulacaktır:\n1.  Nesne başına bir satır\n2. Her satır, sınıf x_center y_center genişlik yükseklik biçimidir.\n3. Kutu koordinatları normalleştirilmiş xywh formatında olmalıdır (0 - 1 arası). x_center ve genişliği görüntü genişliğine ve y_center ve yüksekliği görüntü yüksekliğine bölerek piksel cinsinden kutularla normalleştirebiliriz.\n4. Class numbers are zero-indexed (start from 0).","metadata":{}},{"cell_type":"code","source":"#Etiket sütununun satır değerini ayrıştırarak ham sınırlayıcı kutuyu alın.\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     ","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:46.718677Z","iopub.execute_input":"2022-01-06T16:21:46.719141Z","iopub.status.idle":"2022-01-06T16:21:46.727858Z","shell.execute_reply.started":"2022-01-06T16:21:46.719089Z","shell.execute_reply":"2022-01-06T16:21:46.726459Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Yeniden boyutlandırılan görüntünün boyutuna göre sınırlayıcı kutuları ölçekleyin.\ndef scale_bbox(row, bboxes):\n    # Ölçeklendirme faktörünü al\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","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:46.730160Z","iopub.execute_input":"2022-01-06T16:21:46.730910Z","iopub.status.idle":"2022-01-06T16:21:46.740227Z","shell.execute_reply.started":"2022-01-06T16:21:46.730664Z","shell.execute_reply":"2022-01-06T16:21:46.738562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Sınırlayıcı kutuları YOLO formatında dönüştürün.\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 genişlik yüksekliği\n    \n    return yolo_boxes","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:46.742311Z","iopub.execute_input":"2022-01-06T16:21:46.742821Z","iopub.status.idle":"2022-01-06T16:21:46.751544Z","shell.execute_reply.started":"2022-01-06T16:21:46.742774Z","shell.execute_reply":"2022-01-06T16:21:46.750241Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Sınırlayıcı kutu için txt dosyalarını hazırlayın\nfor i in tqdm(range(len(df))):\n    row = df.loc[i]\n    # resim kimliğini al\n    img_id = row.id\n    # Bölünmek\n    split = row.split\n    # Görüntü düzeyinde etiket alın\n    label = row.image_level\n    \n    if row.split=='train':\n        file_name = f'tmp/covid/labels/train/{row.id}.txt'\n    else:\n        file_name = f'tmp/covid/labels/valid/{row.id}.txt'\n        \n    \n    if label=='opacity':\n         # kutuları al\n        bboxes = get_bbox(row)\n        # Sınırlayıcı kutuları ölçeklendir\n        scale_bboxes = scale_bbox(row, bboxes)\n        # YOLOv5 formatı\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":"2022-01-06T16:21:46.753668Z","iopub.execute_input":"2022-01-06T16:21:46.754398Z","iopub.status.idle":"2022-01-06T16:21:50.893668Z","shell.execute_reply.started":"2022-01-06T16:21:46.754345Z","shell.execute_reply":"2022-01-06T16:21:50.892439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Eğitim","metadata":{}},{"cell_type":"code","source":"%cd tmp/yolov5/","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:50.895378Z","iopub.execute_input":"2022-01-06T16:21:50.896040Z","iopub.status.idle":"2022-01-06T16:21:50.909354Z","shell.execute_reply.started":"2022-01-06T16:21:50.895987Z","shell.execute_reply":"2022-01-06T16:21:50.907468Z"},"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.yaml \\\n                 --weights yolov5s.pt \\\n                --freeze 13","metadata":{"execution":{"iopub.status.busy":"2022-01-06T16:21:50.910881Z","iopub.execute_input":"2022-01-06T16:21:50.911858Z","iopub.status.idle":"2022-01-06T17:11:57.323878Z","shell.execute_reply.started":"2022-01-06T16:21:50.911822Z","shell.execute_reply":"2022-01-06T17:11:57.322529Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Test","metadata":{}},{"cell_type":"code","source":"TEST_PATH = '/kaggle/input/siim-covid19-resized-to-256px-jpg/test/' # test resimlerinin olduğu yer","metadata":{"execution":{"iopub.status.busy":"2022-01-06T17:25:55.676248Z","iopub.execute_input":"2022-01-06T17:25:55.676682Z","iopub.status.idle":"2022-01-06T17:25:55.683100Z","shell.execute_reply.started":"2022-01-06T17:25:55.676641Z","shell.execute_reply":"2022-01-06T17:25:55.681650Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"MODEL_PATH = './runs/train/exp/weights/best.pt' #modelin olduğu yer","metadata":{"execution":{"iopub.status.busy":"2022-01-06T17:26:03.691323Z","iopub.execute_input":"2022-01-06T17:26:03.691717Z","iopub.status.idle":"2022-01-06T17:26:03.696045Z","shell.execute_reply.started":"2022-01-06T17:26:03.691683Z","shell.execute_reply":"2022-01-06T17:26:03.694806Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!python detect.py --weights {MODEL_PATH} \\\n                  --source {TEST_PATH} \\\n                  --img {IMG_SIZE} \\\n                  --conf 0.281 \\\n                  --iou-thres 0.5 \\\n                  --max-det 3 \\\n                  --save-txt \\\n                  --save-conf","metadata":{"execution":{"iopub.status.busy":"2022-01-06T17:26:05.427991Z","iopub.execute_input":"2022-01-06T17:26:05.428426Z","iopub.status.idle":"2022-01-06T17:26:56.539934Z","shell.execute_reply.started":"2022-01-06T17:26:05.428393Z","shell.execute_reply":"2022-01-06T17:26:56.538346Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import glob\n#birkaç resmi diziye alma\npaths = []\nfor i in glob.glob(\"./runs/detect/exp2/\"+\"*.jpg\")[200:250]:\n    paths.append(i)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T17:29:22.549719Z","iopub.execute_input":"2022-01-06T17:29:22.550119Z","iopub.status.idle":"2022-01-06T17:29:22.563549Z","shell.execute_reply.started":"2022-01-06T17:29:22.550085Z","shell.execute_reply":"2022-01-06T17:29:22.562094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"paths","metadata":{"execution":{"iopub.status.busy":"2022-01-06T17:29:23.542915Z","iopub.execute_input":"2022-01-06T17:29:23.543331Z","iopub.status.idle":"2022-01-06T17:29:23.552637Z","shell.execute_reply.started":"2022-01-06T17:29:23.543253Z","shell.execute_reply":"2022-01-06T17:29:23.549751Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Test sonuçları","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(16,10))\nfor i in range(49):\n    plt.subplot(7,7,(i+1))\n    plt.imshow(cv2.imread(paths[i]))","metadata":{"execution":{"iopub.status.busy":"2022-01-06T17:30:27.438821Z","iopub.execute_input":"2022-01-06T17:30:27.439430Z","iopub.status.idle":"2022-01-06T17:30:32.574317Z","shell.execute_reply.started":"2022-01-06T17:30:27.439360Z","shell.execute_reply":"2022-01-06T17:30:32.573245Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}