{"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":"code","source":"import os, glob\nimport sys\nimport json\nfrom PIL import Image\nfrom collections import Counter\n\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\nimport plotly.graph_objects as go\nimport tifffile as tiff\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nimport torch\nimport cv2\n\nimport pandas as pd\n\nfrom sklearn.model_selection import KFold\n\nsys.path.append(\"/kaggle/input/detection-wheel\")","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-07-31T16:46:37.909404Z","iopub.execute_input":"2023-07-31T16:46:37.910386Z","iopub.status.idle":"2023-07-31T16:46:44.088968Z","shell.execute_reply.started":"2023-07-31T16:46:37.910346Z","shell.execute_reply":"2023-07-31T16:46:44.087853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import torch\ntorch.__version__  #torch 2.0\n#!nvidia-smi   #CUDA Version: 11.4\n! ls /usr/local","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:46:44.091393Z","iopub.execute_input":"2023-07-31T16:46:44.092508Z","iopub.status.idle":"2023-07-31T16:46:45.273367Z","shell.execute_reply.started":"2023-07-31T16:46:44.092473Z","shell.execute_reply":"2023-07-31T16:46:45.272139Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install -qqq /kaggle/input/mmdet3-wheels-ando/addict-2.4.0-py3-none-any.whl\n!pip install -qqq /kaggle/input/mmdet3-wheels-ando/mmengine-0.7.3-py3-none-any.whl\n\n!mkdir /kaggle/working/packages\n!cp -r /kaggle/input/pycocotools/* /kaggle/working/packages\nos.chdir(\"/kaggle/working/packages/pycocotools-2.0.6/\")\n!python setup.py install -q\n!pip install . --no-index --find-links /kaggle/working/packages/ -q\n\n!pip install -qqq /kaggle/input/mmdetection-2-26-0/mmdetection-2-26-0/yapf-0.32.0-py2.py3-none-any.whl\n!pip install -qqq /kaggle/input/mmdetection-2-26-0/mmdetection-2-26-0/terminal-0.4.0-py3-none-any.whl\n!pip install -qqq /kaggle/input/mmdetection-2-26-0/mmdetection-2-26-0/terminaltables-3.1.10-py2.py3-none-any.whl\n\n!cp -r /kaggle/input/mmdetection-2-26-0/mmdetection-2-26-0/mmdetection/ /kaggle/working/\n%cd /kaggle/working/mmdetection\n!pip install -e . --no-deps\n%cd /kaggle/working/\n\n!pip install -qqq /kaggle/input/mmdetection-2-26-0/mmdetection-2-26-0/mmdet-2.26.0-py3-none-any.whl\n!pip install -qqq /kaggle/input/mmdet3-wheels/mmcv_full-1.7.1-cp310-cp310-linux_x86_64.whl","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:46:45.275543Z","iopub.execute_input":"2023-07-31T16:46:45.275943Z","iopub.status.idle":"2023-07-31T16:52:05.564347Z","shell.execute_reply.started":"2023-07-31T16:46:45.275908Z","shell.execute_reply":"2023-07-31T16:52:05.562940Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import base64\nimport numpy as np\nfrom pycocotools import _mask as coco_mask\nimport typing as t\nimport zlib","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:05.567773Z","iopub.execute_input":"2023-07-31T16:52:05.569385Z","iopub.status.idle":"2023-07-31T16:52:05.580923Z","shell.execute_reply.started":"2023-07-31T16:52:05.569342Z","shell.execute_reply":"2023-07-31T16:52:05.579719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def encode_binary_mask(mask: np.ndarray) -> t.Text:\n    \"\"\"Converts a binary mask into OID challenge encoding ascii text.\"\"\"\n\n    # check input mask --\n    if mask.dtype != np.bool:\n        raise ValueError(\n        \"encode_binary_mask expects a binary mask, received dtype == %s\" %\n        mask.dtype)\n\n    mask = np.squeeze(mask)\n    if len(mask.shape) != 2:\n        raise ValueError(\n        \"encode_binary_mask expects a 2d mask, received shape == %s\" %\n        mask.shape)\n\n    # convert input mask to expected COCO API input --\n    mask_to_encode = mask.reshape(mask.shape[0], mask.shape[1], 1)\n    mask_to_encode = mask_to_encode.astype(np.uint8)\n    mask_to_encode = np.asfortranarray(mask_to_encode)\n\n    # RLE encode mask --\n    encoded_mask = coco_mask.encode(mask_to_encode)[0][\"counts\"]\n\n    # compress and base64 encoding --\n    binary_str = zlib.compress(encoded_mask, zlib.Z_BEST_COMPRESSION)\n    base64_str = base64.b64encode(binary_str)\n    return base64_str","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:05.582630Z","iopub.execute_input":"2023-07-31T16:52:05.583140Z","iopub.status.idle":"2023-07-31T16:52:05.594192Z","shell.execute_reply.started":"2023-07-31T16:52:05.583106Z","shell.execute_reply":"2023-07-31T16:52:05.593311Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from typing import Text, Dict, Tuple\n\ndef get_glomerulus_mask(annotations: Dict, mask_shape: Tuple = (512, 512)) -> np.ndarray:\n    \"\"\" Converts glomerulus labels into boolean mask \"\"\"\n    mask = np.ones(shape=mask_shape, dtype=np.uint8)\n    \n    for annotation in annotations: \n        if annotation['type'] == 'glomerulus':            \n            coords = np.array(annotation['coordinates'])\n            cv2.fillPoly(mask, pts=coords, color=0)\n\n    return mask.astype(bool)\n    \ndef morphological_gradient(binary_mask):\n    \"\"\"Áp dụng phép toán Morphological Gradient trên binary mask.\n    binary_mask: Binary mask có giá trị 0 hoặc 255.\n\n    Returns:\n    - gradient: Kết quả Morphological Gradient.\n    \"\"\"\n    # Chuyển đổi binary mask về kiểu dữ liệu uint8 nếu cần thiết\n    if binary_mask.dtype != np.uint8:\n        binary_mask = binary_mask.astype(np.uint8)\n\n    # Áp dụng phép toán Morphological Gradient\n    kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5))  # Kích thước kernel\n    gradient = cv2.morphologyEx(binary_mask, cv2.MORPH_GRADIENT, kernel)\n\n    return gradient","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:05.595716Z","iopub.execute_input":"2023-07-31T16:52:05.596195Z","iopub.status.idle":"2023-07-31T16:52:05.607616Z","shell.execute_reply.started":"2023-07-31T16:52:05.596164Z","shell.execute_reply":"2023-07-31T16:52:05.606521Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def convert_to_binary_mask(mask):\n    \"\"\"Chuyển đổi mask sang dạng binary mask True/False.\n    mask: Mask có giá trị 0/255.\n\n    Returns:\n    - binary_mask: Binary mask dạng True/False.\n    \"\"\"\n    binary_mask = (mask > 0)\n    return binary_mask\ndef convert_to_mask(binary_mask):\n    \"\"\"Chuyển đổi binary mask sang dạng mask 0/255.\n    binary_mask: Binary mask dạng True/False.\n\n    Returns:\n    - mask: Mask có giá trị 0/255.\n    \"\"\"\n    mask = binary_mask.astype(np.uint8) * 255\n    return mask\n%mkdir work_dir_test","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:05.608851Z","iopub.execute_input":"2023-07-31T16:52:05.609275Z","iopub.status.idle":"2023-07-31T16:52:06.630545Z","shell.execute_reply.started":"2023-07-31T16:52:05.609243Z","shell.execute_reply":"2023-07-31T16:52:06.629160Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path_list = [\"/kaggle/input/hubmap-hacking-the-human-vasculature/test/\"+i for i in os.listdir(\"/kaggle/input/hubmap-hacking-the-human-vasculature/test/\")]","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:06.632411Z","iopub.execute_input":"2023-07-31T16:52:06.632831Z","iopub.status.idle":"2023-07-31T16:52:06.641621Z","shell.execute_reply.started":"2023-07-31T16:52:06.632792Z","shell.execute_reply":"2023-07-31T16:52:06.640348Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%mkdir /kaggle/working/configs/\n%mkdir /kaggle/working/work_dir_test/","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:06.643401Z","iopub.execute_input":"2023-07-31T16:52:06.643976Z","iopub.status.idle":"2023-07-31T16:52:08.569203Z","shell.execute_reply.started":"2023-07-31T16:52:06.643945Z","shell.execute_reply":"2023-07-31T16:52:08.567861Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import mmdet, mmcv\nprint(mmdet.__version__)\nprint(mmcv.__version__)","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:08.574627Z","iopub.execute_input":"2023-07-31T16:52:08.575135Z","iopub.status.idle":"2023-07-31T16:52:10.517516Z","shell.execute_reply.started":"2023-07-31T16:52:08.575081Z","shell.execute_reply":"2023-07-31T16:52:10.516565Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from mmcv import Config\n# from mmengine.runner import Runner\n\n# from mmdet.utils import register_all_modules\n\n# cfg = Config.fromfile(\"/kaggle/input/hubmap-2023-cascade-rcnn/config.json\")\n\n# cfg.work_dir = \"/kaggle/working/work_dir\"\n# cfg.device = 'cuda' #torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')\n# for head in cfg.model.roi_head.bbox_head:\n#     head.num_classes = 1\n    \n# cfg.model.roi_head.mask_head.num_classes=1\n# cfg.data.train.classes=cfg.classes\n# cfg.data.val.classes=cfg.classes\n# cfg.data.test.classes=cfg.classes","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:22.272786Z","iopub.execute_input":"2023-07-31T16:53:22.273300Z","iopub.status.idle":"2023-07-31T16:53:22.279474Z","shell.execute_reply.started":"2023-07-31T16:53:22.273258Z","shell.execute_reply":"2023-07-31T16:53:22.278509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cfg = Config.fromfile(\"/kaggle/input/mmdetection-2-26-0/mmdetection-2-26-0/mmdetection/configs/htc/htc_x101_64x4d_fpn_16x1_20e_coco.py\")\n# from mmengine.config import Config\n# from mmengine.runner import Runner\n\n# from mmdet.utils import register_all_modules\n\n# cfg = Config.fromfile(\"/kaggle/working/configs/custom_config.py\")\ncfg.data.samples_per_gpu=4\ncfg.seed=0\ncfg.gpu_ids = range(0, 1)\ncfg.fp16 = dict(loss_scale=512.0)\ncfg.classes=('blood_vessel',)\ncfg.work_dir = \"/kaggle/working/work_dir\"\ncfg.device = 'cuda' #torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')\nfor head in cfg.model.roi_head.bbox_head:\n    head.num_classes = 1\n\nfor head in cfg.model.roi_head.mask_head:\n    head.num_classes=1\n    \ncfg.data.train.classes=cfg.classes\ncfg.data.val.classes=cfg.classes\ncfg.data.test.classes=cfg.classes\n\ncfg.train_pipeline[2].img_scale=(1024,1024)\ndel cfg.train_pipeline[5]\ndel cfg.train_pipeline[5]\ncfg.test_pipeline[1].img_scale=(1024,1024)\ndel cfg.test_pipeline[1].transforms[3]\ncfg.train_pipeline[1].with_seg=False\ncfg.train_pipeline[6][\"keys\"]=[\"img\", \"gt_bboxes\", \"gt_labels\", \"gt_masks\"]\ncfg.data.train.ann_file='/kaggle/working/coco_annotations_train_all.json'#'/kaggle/input/hubmap-human-vasculature-mmdet-models/coco_annotations_train_all_fold1.json'\ncfg.data.train.img_prefix='/kaggle/input/hubmap-hacking-the-human-vasculature/train'\n\ncfg.data.val.ann_file='/kaggle/working/coco_annotations_valid_all.json'#'/kaggle/input/hubmap-human-vasculature-mmdet-models/coco_annotations_valid_all_fold1.json'\ncfg.data.val.img_prefix='/kaggle/input/hubmap-hacking-the-human-vasculature/train'\n\ncfg.data.test.ann_file='/kaggle/working/coco_annotations_valid_all.json'#'/kaggle/input/hubmap-human-vasculature-mmdet-models/coco_annotations_valid_all_fold1.json'\ncfg.data.test.img_prefix='/kaggle/input/hubmap-hacking-the-human-vasculature/train'\n\ncfg.data.train.pipeline = cfg.train_pipeline\ncfg.data.val.pipeline = cfg.test_pipeline\ncfg.data.test.pipeline = cfg.test_pipeline\n\n\ncfg.runner.max_epochs=30\ndel cfg.model.roi_head.semantic_roi_extractor\ndel cfg.model.roi_head.semantic_head\n# cfg.train_pipeline[1].with_seg=False\n# del cfg.data.train.seg_prefix","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:25.188211Z","iopub.execute_input":"2023-07-31T16:53:25.188610Z","iopub.status.idle":"2023-07-31T16:53:25.250948Z","shell.execute_reply.started":"2023-07-31T16:53:25.188577Z","shell.execute_reply":"2023-07-31T16:53:25.250029Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# cfg.img_norm_cfg = dict(\n#     mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)\ncfg.test_pipeline=[\n    dict(type='LoadImageFromFile'),\n#     dict(type='Resize', img_scale=(512, 512), keep_ratio=True),\n    dict(\n        type='MultiScaleFlipAug',\n        img_scale=(1024, 1024),\n        flip=True,\n        transforms=[\n            dict(type='Resize', keep_ratio=True),\n            dict(type='RandomFlip'),\n            dict(type='Normalize', **cfg.img_norm_cfg),\n#             dict(type='Pad', size_divisor=32),\n            dict(type='ImageToTensor', keys=['img']),\n            dict(type='Collect', keys=['img'])\n        ])\n]\n\n# [\n#     { \"type\": \"LoadImageFromFile\" },\n#     {\n#       \"type\": \"MultiScaleFlipAug\",\n#       \"img_scale\": [1024, 1024],\n#       \"flip\": TR,\n#       \"transforms\": [\n#         { \"type\": \"Resize\", \"keep_ratio\": true },\n#         { \"type\": \"RandomFlip\" },\n#         {\n#           \"type\": \"Normalize\",\n#           \"mean\": [123.675, 116.28, 103.53],\n#           \"std\": [58.395, 57.12, 57.375],\n#           \"to_rgb\": true\n#         },\n#         { \"type\": \"ImageToTensor\", \"keys\": [\"img\"] },\n#         { \"type\": \"Collect\", \"keys\": [\"img\"] }\n#       ]\n#     }\n#   ]\n\ncfg.data.test.pipeline=cfg.test_pipeline\ncfg[\"model\"][\"test_cfg\"][\"rcnn\"][\"score_thr\"]=0\ncfg[\"model\"][\"test_cfg\"][\"rcnn\"][\"max_per_img\"]=1000","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:26.811822Z","iopub.execute_input":"2023-07-31T16:53:26.812225Z","iopub.status.idle":"2023-07-31T16:53:26.820819Z","shell.execute_reply.started":"2023-07-31T16:53:26.812194Z","shell.execute_reply":"2023-07-31T16:53:26.819834Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# print(cfg.pretty_text)","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:27.588928Z","iopub.execute_input":"2023-07-31T16:53:27.589669Z","iopub.status.idle":"2023-07-31T16:53:27.594517Z","shell.execute_reply.started":"2023-07-31T16:53:27.589635Z","shell.execute_reply":"2023-07-31T16:53:27.593359Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from mmdet.datasets import build_dataset\nfrom mmdet.models import build_detector\nfrom mmdet.apis import train_detector\nfrom mmdet.apis import inference_detector, init_detector, show_result_pyplot, set_random_seed","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:28.254950Z","iopub.execute_input":"2023-07-31T16:53:28.255641Z","iopub.status.idle":"2023-07-31T16:53:29.767648Z","shell.execute_reply.started":"2023-07-31T16:53:28.255607Z","shell.execute_reply":"2023-07-31T16:53:29.766633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# model = init_detector(cfg, checkpoint=\"/kaggle/input/hubmap-2023-cascade-rcnn/work_dir/best_segm_mAP_epoch_6.pth\",device='cuda')\nmodel = init_detector(cfg, \n        checkpoint=\"/kaggle/input/hubmap-human-vasculature-mmdet-models/htc_x101_64x4d_fpn_16x1_20e_coco_1024x1024_v0_epoch_13.pth\",\n        device='cuda')\n\n# model.CLASSES = datasets[0].CLASSES","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:29.769976Z","iopub.execute_input":"2023-07-31T16:53:29.770386Z","iopub.status.idle":"2023-07-31T16:53:42.932032Z","shell.execute_reply.started":"2023-07-31T16:53:29.770353Z","shell.execute_reply":"2023-07-31T16:53:42.930962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ids = []\nheights = []\nwidths = []\nprediction_string = []\n\nfor img in path_list:\n    try:\n        img_array = mmcv.imread(img,channel_order='rgb')\n#         img_array = mmcv.imresize(img_array, (1024, 1024), return_scale=False)\n\n#         img_array = (img_array-mean)/std\n        [h, w, c] = img_array.shape \n        pred=inference_detector(model,imgs=[img])[0]\n#         pred1=inference_detector(model1,imgs=[img])[0]\n#         pred = (pred+pred1)/2\n        pred_string = ''\n        pred_class = pred[0]\n        pred_mask = pred[1]\n        for i, classe in enumerate(pred_class):\n            if classe.shape != (0, 5):\n                if(i==0): #blood case \n                    bbs = classe\n                    #print(bbs)\n                    sgs = pred_mask[i]\n                    m=0\n                    validcount=0\n                    for bb, sg in zip(bbs,sgs):\n                        box = bb[:4]\n                        cnf = bb[4] \n                        if cnf>0.7:\n                            cnf+=0.11\n                        elif cnf>0.5:\n                            cnf+=0.13\n                        sg = sg.astype(np.uint8)\n                        kernel = np.ones(shape=(3, 3), dtype=np.uint8)\n                        binary_mask = cv2.dilate(sg, kernel, 4)    \n                        binary_mask = binary_mask.astype(bool)                    \n                        #-------------------------\n\n                        encoded = encode_binary_mask(binary_mask)\n                        if m==0:\n                            pred_string += f\"0 {cnf} {encoded.decode('utf-8')}\"\n                            m=m+1\n                        else:\n                            pred_string += f\" 0 {cnf} {encoded.decode('utf-8')}\"\n        \n    except Exception as e:\n        print(\"ERROR\",e)\n        h, w=(512,512)\n        pred_string = \"\"\n    ids.append(os.path.basename(img).split('.')[0])\n    heights.append(h)\n    widths.append(w)\n    prediction_string.append(pred_string)\n\nsub = pd.DataFrame({\"id\": ids, \"height\": heights, \"width\": widths, \"prediction_string\": prediction_string})\nsub = sub.set_index(\"id\")\nsub.to_csv(\"submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:42.934089Z","iopub.execute_input":"2023-07-31T16:53:42.934489Z","iopub.status.idle":"2023-07-31T16:53:48.682278Z","shell.execute_reply.started":"2023-07-31T16:53:42.934456Z","shell.execute_reply":"2023-07-31T16:53:48.681181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:48.684309Z","iopub.execute_input":"2023-07-31T16:53:48.685039Z","iopub.status.idle":"2023-07-31T16:53:48.702137Z","shell.execute_reply.started":"2023-07-31T16:53:48.684990Z","shell.execute_reply":"2023-07-31T16:53:48.701172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub[\"prediction_string\"][0]","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:53:53.050502Z","iopub.execute_input":"2023-07-31T16:53:53.051132Z","iopub.status.idle":"2023-07-31T16:53:53.060728Z","shell.execute_reply.started":"2023-07-31T16:53:53.051063Z","shell.execute_reply":"2023-07-31T16:53:53.059664Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# model(img_array)","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:11.122228Z","iopub.status.idle":"2023-07-31T16:52:11.123062Z","shell.execute_reply.started":"2023-07-31T16:52:11.122783Z","shell.execute_reply":"2023-07-31T16:52:11.122807Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!rm -rf /kaggle/working/work_dir_test\n!rm -rf /kaggle/working/packages\n!rm -rf /kaggle/working/mmdetection\n!rm -rf /kaggle/working/configs","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:11.124516Z","iopub.status.idle":"2023-07-31T16:52:11.125299Z","shell.execute_reply.started":"2023-07-31T16:52:11.125041Z","shell.execute_reply":"2023-07-31T16:52:11.125064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# np.sum(pred[0]+pred1[0])","metadata":{"execution":{"iopub.status.busy":"2023-07-31T16:52:11.126683Z","iopub.status.idle":"2023-07-31T16:52:11.127497Z","shell.execute_reply.started":"2023-07-31T16:52:11.127249Z","shell.execute_reply":"2023-07-31T16:52:11.127273Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}