{"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":"nvidiaTeslaT4","dataSources":[{"sourceId":71549,"databundleVersionId":8561470,"sourceType":"competition"},{"sourceId":184645698,"sourceType":"kernelVersion"},{"sourceId":185085577,"sourceType":"kernelVersion"},{"sourceId":187906948,"sourceType":"kernelVersion"},{"sourceId":188023704,"sourceType":"kernelVersion"}],"dockerImageVersionId":30733,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport sys\nimport os\nfrom matplotlib import pyplot as plt\nimport cv2 as cv\nfrom PIL import Image\nimport ctypes\nimport gc\n\ndef clean_memory():\n    gc.collect()\n    ctypes.CDLL(\"libc.so.6\").malloc_trim(0)\n    torch.cuda.empty_cache()\n!pip install transformers==4.42.0\nimport transformers\ntransformers.__version__","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2024-11-10T20:45:13.281034Z","iopub.execute_input":"2024-11-10T20:45:13.281369Z","iopub.status.idle":"2024-11-10T20:45:44.728449Z","shell.execute_reply.started":"2024-11-10T20:45:13.281333Z","shell.execute_reply":"2024-11-10T20:45:44.727545Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#two channels vs 3\n#coordinates vs boxes","metadata":{},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import torch\n\nfrom PIL import Image\nfrom transformers import RTDetrForObjectDetection, RTDetrImageProcessor,RTDetrConfig\nfrom transformers.image_transforms import center_to_corners_format\nfrom torch.utils.data import DataLoader\n\n\nimage_processor = RTDetrImageProcessor.from_pretrained(\"PekingU/rtdetr_r50vd_coco_o365\")\nimage_processor.save_pretrained('image_processor')\nconfig = RTDetrConfig.from_pretrained(\"PekingU/rtdetr_r50vd_coco_o365\")\nconfig.num_labels = 1\n# label_to_id = {k:v for k,v in zip(['left_neural_foraminal_narrowing_l1_l2',\n#        'left_neural_foraminal_narrowing_l2_l3',\n#        'left_neural_foraminal_narrowing_l3_l4',\n#        'left_neural_foraminal_narrowing_l4_l5',\n#        'left_neural_foraminal_narrowing_l5_s1',\n#        'left_subarticular_stenosis_l1_l2', 'left_subarticular_stenosis_l2_l3',\n#        'left_subarticular_stenosis_l3_l4', 'left_subarticular_stenosis_l4_l5',\n#        'left_subarticular_stenosis_l5_s1',\n#        'right_neural_foraminal_narrowing_l1_l2',\n#        'right_neural_foraminal_narrowing_l2_l3',\n#        'right_neural_foraminal_narrowing_l3_l4',\n#        'right_neural_foraminal_narrowing_l4_l5',\n#        'right_neural_foraminal_narrowing_l5_s1',\n#        'right_subarticular_stenosis_l1_l2',\n#        'right_subarticular_stenosis_l2_l3',\n#        'right_subarticular_stenosis_l3_l4',\n#        'right_subarticular_stenosis_l4_l5',\n#        'right_subarticular_stenosis_l5_s1', 'spinal_canal_stenosis_l1_l2',\n#        'spinal_canal_stenosis_l2_l3', 'spinal_canal_stenosis_l3_l4',\n#        'spinal_canal_stenosis_l4_l5', 'spinal_canal_stenosis_l5_s1'], range(25))}\n# id_to_label = {v:k for k,v in label_to_id.items()}\n# config.id2label = id_to_label\n# config.label2id = label_to_id\n\nmodel = RTDetrForObjectDetection.from_pretrained(\"/kaggle/input/process-metadata/cv_model\", config = config,ignore_mismatched_sizes=True)\nsum(p.numel() for p in model.parameters() if p.requires_grad)","metadata":{"execution":{"iopub.status.busy":"2024-11-10T22:50:00.709803Z","iopub.execute_input":"2024-11-10T22:50:00.710164Z","iopub.status.idle":"2024-11-10T22:50:02.378542Z","shell.execute_reply.started":"2024-11-10T22:50:00.710136Z","shell.execute_reply":"2024-11-10T22:50:02.377653Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# meta = pd.read_csv('/kaggle/input/rsna-dataset/detailed_label.csv')\n# add = pd.read_csv('/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_series_descriptions.csv')\n# meta = meta.merge(add, on = ['study_id', 'series_id'])\n# meta[meta.study_id == 4003253]","metadata":{"execution":{"iopub.status.busy":"2024-07-11T04:21:50.160963Z","iopub.execute_input":"2024-07-11T04:21:50.161498Z","iopub.status.idle":"2024-07-11T04:21:50.452957Z","shell.execute_reply.started":"2024-07-11T04:21:50.161447Z","shell.execute_reply":"2024-07-11T04:21:50.451826Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2024-07-11T04:21:53.566507Z","iopub.execute_input":"2024-07-11T04:21:53.567623Z","iopub.status.idle":"2024-07-11T04:21:53.596755Z","shell.execute_reply.started":"2024-07-11T04:21:53.56758Z","shell.execute_reply":"2024-07-11T04:21:53.595442Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import pickle\nwith open('/kaggle/input/process-metadata/data.pkl', 'rb') as f:\n    data = pickle.load(f)","metadata":{"execution":{"iopub.status.busy":"2024-11-10T21:02:13.128760Z","iopub.execute_input":"2024-11-10T21:02:13.129439Z","iopub.status.idle":"2024-11-10T21:02:13.369309Z","shell.execute_reply.started":"2024-11-10T21:02:13.129410Z","shell.execute_reply":"2024-11-10T21:02:13.368477Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#filter for only 'left_neural_foraminal_narrowing_l3_l4'\ndata_single_class = []\nfor pic in data:\n    if 2 in pic['labels']['class_labels']:\n        filt = pic['labels']['class_labels'] == 2\n        pic['labels']['class_labels'] = pic['labels']['class_labels'][filt]\n        pic['labels']['boxes'] = pic['labels']['boxes'][filt]\n        pic['classification'] = pic['classification'][filt]\n        data_single_class.append(pic)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-10T21:02:41.103562Z","iopub.execute_input":"2024-11-10T21:02:41.104324Z","iopub.status.idle":"2024-11-10T21:02:41.307202Z","shell.execute_reply.started":"2024-11-10T21:02:41.104292Z","shell.execute_reply":"2024-11-10T21:02:41.306138Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#train, test split\ndata = data_single_class\nl = int(len(data)*.8)\ntrain = data[:l]\ntest = data[l:]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-10T21:02:43.014778Z","iopub.execute_input":"2024-11-10T21:02:43.015444Z","iopub.status.idle":"2024-11-10T21:02:43.046300Z","shell.execute_reply.started":"2024-11-10T21:02:43.015413Z","shell.execute_reply":"2024-11-10T21:02:43.045236Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# i = 327\n# flag = True\n# while flag:\n#     if data[i]['classification'][0] ==2:\n#         flag = False\n#     i += 1\n# i-1","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-10T21:23:08.200211Z","iopub.execute_input":"2024-11-10T21:23:08.200551Z","iopub.status.idle":"2024-11-10T21:23:08.207611Z","shell.execute_reply.started":"2024-11-10T21:23:08.200526Z","shell.execute_reply":"2024-11-10T21:23:08.206677Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"current_image = data[3]\nimages = Image.open(current_image['filename']).convert(\"RGB\")\n\nplt.imshow(images, cmap=plt.cm.gray)\nplt.colorbar()\nplt.title(f'Normal Spine l3_l4')\nplt.xlabel('X-axis')\nplt.ylabel('Y-axis')\nx,y = current_image['labels']['boxes'][0]\nplt.plot(x,y, '.', markersize=50,fillstyle='none',label = f'localization')\ncurrent_image","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-10T21:21:39.509034Z","iopub.execute_input":"2024-11-10T21:21:39.509931Z","iopub.status.idle":"2024-11-10T21:21:39.967858Z","shell.execute_reply.started":"2024-11-10T21:21:39.509898Z","shell.execute_reply":"2024-11-10T21:21:39.966959Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"current_image = data[328]\nimages = Image.open(current_image['filename']).convert(\"RGB\")\n\nplt.imshow(images, cmap=plt.cm.gray)\nplt.colorbar()\nplt.title(f'Severe spinal stenosis l3_l4')\nplt.xlabel('X-axis')\nplt.ylabel('Y-axis')\nx,y = current_image['labels']['boxes'][0]\nplt.plot(x,y, '.', markersize=50,fillstyle='none',label = f'localization')\ncurrent_image","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-10T21:23:16.550106Z","iopub.execute_input":"2024-11-10T21:23:16.550485Z","iopub.status.idle":"2024-11-10T21:23:16.988021Z","shell.execute_reply.started":"2024-11-10T21:23:16.550457Z","shell.execute_reply":"2024-11-10T21:23:16.987145Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from typing import Optional, Union\nfrom torch.utils.data.distributed import DistributedSampler\nfrom dataclasses import dataclass\n\n@dataclass\nclass DataCollator:\n    #device: str\n    processor: None\n    \n    def __call__(self, features):\n        filename = [sample['filename'] for sample in features]\n        labels = [sample['labels'].copy() for sample in features]\n        batch_size = len(features)\n        \n        images = [Image.open(f).convert(\"RGB\") for f in filename]\n        batch = self.processor(images=images, return_tensors=\"pt\")\n        #scale the x and y to normalized coco\n        sizes = []\n        for i in range(len(labels)):\n            size = images[i].size #width and height of original photo\n            sizes.append(size)\n            xy = labels[i]['boxes']/size\n            formatted_box = np.concatenate([xy, np.repeat([[5/size[0],5/size[1]]],len(xy),0)], axis = 1)\n            labels[i]['boxes'] = torch.tensor(formatted_box, dtype = torch.float, device = device)\n            #labels[i]['class_labels'] = torch.tensor(labels[i]['class_labels'], dtype = torch.long, device = device)\n            labels[i]['class_labels'] = torch.tensor([0], dtype = torch.long, device = device)\n        batch['labels'] = labels\n        batch['sizes'] = sizes\n        batch['filename'] = filename\n        batch['pixel_values'] = batch['pixel_values'].to(device)\n        return batch","metadata":{"execution":{"iopub.status.busy":"2024-11-10T21:33:28.444607Z","iopub.execute_input":"2024-11-10T21:33:28.445282Z","iopub.status.idle":"2024-11-10T21:33:28.455638Z","shell.execute_reply.started":"2024-11-10T21:33:28.445251Z","shell.execute_reply":"2024-11-10T21:33:28.454712Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# loader = DataLoader(train, collate_fn = DataCollator(image_processor), batch_size = 8,drop_last=True,shuffle = True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-10T21:26:01.752298Z","iopub.execute_input":"2024-11-10T21:26:01.752661Z","iopub.status.idle":"2024-11-10T21:26:01.758958Z","shell.execute_reply.started":"2024-11-10T21:26:01.752633Z","shell.execute_reply":"2024-11-10T21:26:01.758137Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#move model to gpu\ndevice = 1\nmodel.to(1)\n69","metadata":{"execution":{"iopub.status.busy":"2024-11-10T22:56:55.360666Z","iopub.execute_input":"2024-11-10T22:56:55.361001Z","iopub.status.idle":"2024-11-10T22:56:55.540101Z","shell.execute_reply.started":"2024-11-10T22:56:55.360977Z","shell.execute_reply":"2024-11-10T22:56:55.539218Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import ctypes\nimport gc\ndef clean_memory():\n    gc.collect()\n    ctypes.CDLL(\"libc.so.6\").malloc_trim(0)\n    torch.cuda.empty_cache()\nclean_memory()","metadata":{"execution":{"iopub.status.busy":"2024-11-10T22:56:56.959715Z","iopub.execute_input":"2024-11-10T22:56:56.960368Z","iopub.status.idle":"2024-11-10T22:56:57.459647Z","shell.execute_reply.started":"2024-11-10T22:56:56.960340Z","shell.execute_reply":"2024-11-10T22:56:57.458652Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from transformers import get_cosine_schedule_with_warmup\n\n\nlearning_rate = 1e-4\nepochs = 10\nbatch_size = 8\nsteps_per_epoch = len(train)//batch_size+1\noptimizer = torch.optim.AdamW(model.parameters(), lr=learning_rate)\n\nscheduler = None\nscheduler = get_cosine_schedule_with_warmup(optimizer,\n                                            num_warmup_steps = (steps_per_epoch*epochs)//20,\n                                            num_training_steps = steps_per_epoch*epochs)\n\n\nif device != \"cpu\":\n    scaler = torch.cuda.amp.GradScaler(enabled= True)\n    \nfrom time import time\nloader = DataLoader(train, collate_fn = DataCollator(image_processor), batch_size = batch_size,drop_last=True,shuffle = True)\nfor i in range(epochs):\n    loss_history = []\n    for idx, batch in enumerate(loader):\n        start = time()\n        with torch.cuda.amp.autocast(enabled=True):\n            output = model(pixel_values = batch['pixel_values'], labels = batch['labels'])\n            loss = output.loss\n        scaler.scale(loss).backward()\n        scaler.step(optimizer)\n\n        # Updates the scale for next iteration.\n        scaler.update()\n        optimizer.zero_grad()\n        if scheduler:\n            scheduler.step()\n            \n        loss_history.append(loss.detach().cpu().numpy())\n        #if (idx+1)%100 == 0: print(loss_history[-1], time()- start)\n    print(\"epoch mean loss history\", np.mean(loss_history))\n    plt.plot(loss_history)\n    plt.show()\n    model.save_pretrained(f\"epoch{i+1}\")\n    clean_memory()\n    \n    val_loader = DataLoader(test, collate_fn = DataCollator(image_processor), batch_size = 32,drop_last=False,shuffle = False)\n    loss_history_val = []\n    detections = []\n    for batch in val_loader:\n        with torch.no_grad():\n            output = model(pixel_values = batch['pixel_values'], labels = batch['labels'])\n            loss = output.loss\n            labels =  [{k:v.cpu().numpy() for k,v in p.items()} for p in batch['labels']]\n            detections.append({'logits':output.logits.cpu().numpy(), 'boxes': output.pred_boxes.cpu().numpy(), 'sizes':batch['sizes'],'labels': labels})\n            loss_history_val.append(loss.detach().cpu().numpy())\n    print(\"val loss\", np.mean(loss_history_val))","metadata":{"execution":{"iopub.status.busy":"2024-11-10T22:57:02.821113Z","iopub.execute_input":"2024-11-10T22:57:02.821642Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.plot(loss_history)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:36:56.693616Z","iopub.execute_input":"2024-07-12T02:36:56.694427Z","iopub.status.idle":"2024-07-12T02:36:56.865745Z","shell.execute_reply.started":"2024-07-12T02:36:56.694392Z","shell.execute_reply":"2024-07-12T02:36:56.864865Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#np.mean(loss_history[1500:])","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:36:48.374867Z","iopub.execute_input":"2024-07-12T02:36:48.375254Z","iopub.status.idle":"2024-07-12T02:36:48.381813Z","shell.execute_reply.started":"2024-07-12T02:36:48.375202Z","shell.execute_reply":"2024-07-12T02:36:48.380746Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"clean_memory()","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:19:20.89991Z","iopub.execute_input":"2024-07-12T02:19:20.900215Z","iopub.status.idle":"2024-07-12T02:19:21.338694Z","shell.execute_reply.started":"2024-07-12T02:19:20.900183Z","shell.execute_reply":"2024-07-12T02:19:21.337869Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"val_loader = DataLoader(test, collate_fn = DataCollator(image_processor), batch_size = 32,drop_last=False,shuffle = False)\n\nloss_history_val = []\ndetections = []\nfor batch in val_loader:\n    with torch.no_grad():\n        output = model(pixel_values = batch['pixel_values'], labels = batch['labels'])\n        loss = output.loss\n        labels =  [{k:v.cpu().numpy() for k,v in p.items()} for p in batch['labels']]\n        detections.append({'logits':output.logits.cpu().numpy(), 'boxes': output.pred_boxes.cpu().numpy(), 'sizes':batch['sizes'],'labels': labels})\n        loss_history_val.append(loss.detach().cpu().numpy())\nnp.mean(loss_history_val)\n    #break","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:19:21.340697Z","iopub.execute_input":"2024-07-12T02:19:21.341027Z","iopub.status.idle":"2024-07-12T02:27:10.130336Z","shell.execute_reply.started":"2024-07-12T02:19:21.340999Z","shell.execute_reply":"2024-07-12T02:27:10.129317Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import pickle\nwith open('data.pkl', 'wb') as f:\n    pickle.dump(detections,f)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#detections[0]['boxes']#[:,:,:2]#*np.array(detections[0]['sizes'])","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:45:55.196117Z","iopub.execute_input":"2024-07-12T02:45:55.197015Z","iopub.status.idle":"2024-07-12T02:45:55.205278Z","shell.execute_reply.started":"2024-07-12T02:45:55.196979Z","shell.execute_reply":"2024-07-12T02:45:55.204291Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#score, indice = torch.tensor(detections[0]['logits']).sigmoid().max(-1)","metadata":{"execution":{"iopub.status.busy":"2024-07-12T03:05:42.041734Z","iopub.execute_input":"2024-07-12T03:05:42.042099Z","iopub.status.idle":"2024-07-12T03:05:42.049758Z","shell.execute_reply.started":"2024-07-12T03:05:42.042069Z","shell.execute_reply":"2024-07-12T03:05:42.048778Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#test[0]","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:50:01.024629Z","iopub.execute_input":"2024-07-12T02:50:01.025126Z","iopub.status.idle":"2024-07-12T02:50:01.032769Z","shell.execute_reply.started":"2024-07-12T02:50:01.025084Z","shell.execute_reply":"2024-07-12T02:50:01.031764Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"\n# import requests\n# image = Image.open('/kaggle/input/yolo-dataset/dataset/images/train/3453722652_3908783249_6.jpg').convert(\"RGB\")\n# #img = np.array(img)\n# inputs = image_processor(images=image, return_tensors=\"pt\")\n\n# with torch.no_grad():\n#     outputs = model(inputs['pixel_values'].to(0))","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:50:59.570844Z","iopub.execute_input":"2024-07-12T02:50:59.571517Z","iopub.status.idle":"2024-07-12T02:50:59.720274Z","shell.execute_reply.started":"2024-07-12T02:50:59.571482Z","shell.execute_reply":"2024-07-12T02:50:59.719446Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# results = image_processor.post_process_object_detection(outputs, target_sizes=torch.tensor([image.size[::-1]]), threshold=1/25)\n# for result in results:\n#     for score, label_id, box in zip(result[\"scores\"], result[\"labels\"], result[\"boxes\"]):\n#         score, label = score.item(), label_id.item()\n#         box = [round(i, 2) for i in box.tolist()]\n#         print(f\"{model.config.id2label[label]}: {score:.2f} {box}\")\n\n# image_data = image\n# plt.imshow(image_data, cmap=plt.cm.gray)\n# plt.colorbar()\n# plt.title('Object labels with Square')\n# plt.xlabel('X-axis')\n# plt.ylabel('Y-axis')\n# result = results[0]\n# for score, label_id, box in zip(result[\"scores\"][:5], result[\"labels\"][:5], result[\"boxes\"][:5]):\n#     score, label = score.item(), label_id.item()\n#     box = [round(i, 2) for i in box.tolist()]\n#     #print(f\"{model.config.id2label[label]}: {score:.2f} {box}\")\n\n#     # Plot the DICOM image\n\n\n#     # Calculate the corners of the square\n#     #half_side = side_length / 2\n#     square_x = [box[0], box[2], box[2], box[0], box[0]]\n#     square_y = [box[1], box[1], box[3], box[3], box[1]]\n\n#     # Plot the square\n#     plt.plot(square_x, square_y, '-',label = f'{np.round(score,2)}:{model.config.id2label[label]}')\n#     #plt.scatter([center_x], [center_y], color='blue')  # Mark the center point\n# plt.legend()\n# plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:59:12.473921Z","iopub.execute_input":"2024-07-12T02:59:12.474315Z","iopub.status.idle":"2024-07-12T02:59:12.95048Z","shell.execute_reply.started":"2024-07-12T02:59:12.47428Z","shell.execute_reply":"2024-07-12T02:59:12.949601Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:51:39.648511Z","iopub.execute_input":"2024-07-12T02:51:39.648949Z","iopub.status.idle":"2024-07-12T02:51:39.682604Z","shell.execute_reply.started":"2024-07-12T02:51:39.648915Z","shell.execute_reply":"2024-07-12T02:51:39.681543Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2024-07-12T02:46:53.544326Z","iopub.execute_input":"2024-07-12T02:46:53.544698Z","iopub.status.idle":"2024-07-12T02:46:53.551449Z","shell.execute_reply.started":"2024-07-12T02:46:53.544666Z","shell.execute_reply":"2024-07-12T02:46:53.550364Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2024-07-11T02:09:32.337232Z","iopub.execute_input":"2024-07-11T02:09:32.337643Z","iopub.status.idle":"2024-07-11T02:09:32.782999Z","shell.execute_reply.started":"2024-07-11T02:09:32.337609Z","shell.execute_reply":"2024-07-11T02:09:32.781781Z"},"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# with open('data.pkl', 'rb') as f:\n#     test = pickle.load(f)","metadata":{"execution":{"iopub.status.busy":"2024-07-11T02:09:58.797967Z","iopub.execute_input":"2024-07-11T02:09:58.79837Z","iopub.status.idle":"2024-07-11T02:09:58.977002Z","shell.execute_reply.started":"2024-07-11T02:09:58.798333Z","shell.execute_reply":"2024-07-11T02:09:58.97592Z"},"trusted":true},"outputs":[],"execution_count":null}]}