{"cells":[{"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5"},"cell_type":"markdown","source":"# Description\nThis kernel creates an image dataset for train based on the competition data. Use of images allows to avoid loading the entire dataset into memory, which may be important for running experiments at kaggle. Meanwhile the inference can be done  by loading the dataset part by part without saving it as images to improve the speed.\n\nThe original images are cropped keeping only the characters and resized to 128x128 with adding the corresponding padding to maintain the aspect ratio (see images plot in the kernel). The stats of the produced images are also computed."},{"metadata":{"trusted":true},"cell_type":"code","source":"!pip install /kaggle/input/efficientnet-pytorch -f ./ --no-index","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"!pip install /kaggle/input/pretrainedmodels -f ./ --no-index","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"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 in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_kg_hide-input":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"import cv2\nfrom tqdm import tqdm_notebook as tqdm\nimport zipfile\nimport io\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport warnings\nwarnings.filterwarnings(\"ignore\")","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"HEIGHT = 137\nWIDTH = 236\nSIZE = 128\n\nTRAIN = ['../input/bengaliai-cv19/test_image_data_0.parquet',\n         '../input/bengaliai-cv19/test_image_data_1.parquet',\n         '../input/bengaliai-cv19/test_image_data_2.parquet',\n         '../input/bengaliai-cv19/test_image_data_3.parquet']\n\nOUT_TRAIN = 'test_128.zip'","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df = pd.read_parquet(TRAIN[0])\n# df.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def bbox(img):\n    rows = np.any(img, axis=1)\n    cols = np.any(img, axis=0)\n    rmin, rmax = np.where(rows)[0][[0, -1]]\n    cmin, cmax = np.where(cols)[0][[0, -1]]\n    return rmin, rmax, cmin, cmax\n\ndef crop_resize(img0, size=SIZE, pad=16):\n    #crop a box around pixels large than the threshold \n    #some images contain line at the sides\n    ymin,ymax,xmin,xmax = bbox(img0[5:-5,5:-5] > 80)\n    #cropping may cut too much, so we need to add it back\n    xmin = xmin - 13 if (xmin > 13) else 0\n    ymin = ymin - 10 if (ymin > 10) else 0\n    xmax = xmax + 13 if (xmax < WIDTH - 13) else WIDTH\n    ymax = ymax + 10 if (ymax < HEIGHT - 10) else HEIGHT\n    img = img0[ymin:ymax,xmin:xmax]\n    #remove lo intensity pixels as noise\n    img[img < 28] = 0\n    lx, ly = xmax-xmin,ymax-ymin\n    l = max(lx,ly) + pad\n    #make sure that the aspect ratio is kept in rescaling\n    img = np.pad(img, [((l-ly)//2,), ((l-lx)//2,)], mode='constant')\n    return cv2.resize(img,(size,size))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# # df = pd.read_parquet(TRAIN[0])\n# n_imgs = 2\n# fig, axs = plt.subplots(n_imgs, 2, figsize=(10, 5*n_imgs))\n\n# for idx in range(n_imgs):\n#     #somehow the original input is inverted\n#     img0 = 255 - df.iloc[idx, 1:].values.reshape(HEIGHT, WIDTH).astype(np.uint8)\n# #     img0 = df.iloc[idx, 1:].values.reshape(HEIGHT, WIDTH).astype(np.uint8)\n#     #normalize each image by its max val\n#     img = (img0*(255.0/img0.max())).astype(np.uint8)\n#     img = crop_resize(img)\n# #     print(img[100])\n# #     axs[idx,0].imshow(img0)\n#     axs[idx,0].imshow(img0, cmap='gray')\n#     axs[idx,0].set_title('Original image')\n#     axs[idx,0].axis('off')\n#     axs[idx,1].imshow(img, cmap='gray')\n#     axs[idx,1].set_title('Crop & resize')\n#     axs[idx,1].axis('off')\n# plt.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-output":true,"trusted":true},"cell_type":"code","source":"x_tot,x2_tot = [],[]\nwith zipfile.ZipFile(OUT_TRAIN, 'w') as img_out:\n    for fname in TRAIN:\n        df = pd.read_parquet(fname)\n        #the input is inverted\n        data = 255 - df.iloc[:, 1:].values.reshape(-1, HEIGHT, WIDTH).astype(np.uint8)\n        for idx in tqdm(range(len(df))):\n            name = df.iloc[idx,0]\n            #normalize each image by its max val\n            img = (data[idx]*(255.0/data[idx].max())).astype(np.uint8)\n            img = crop_resize(img)\n        \n            x_tot.append((img/255.0).mean())\n            x2_tot.append(((img/255.0)**2).mean()) \n            img = cv2.imencode('.png',img)[1]\n            img_out.writestr(name + '.png', img)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#image stats\nimg_avr =  np.array(x_tot).mean()\nimg_std =  np.sqrt(np.array(x2_tot).mean() - img_avr**2)\nprint('mean:',img_avr, ', std:', img_std)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import torch.nn as nn\nimport pretrainedmodels\nimport pretrainedmodels.utils\nimport torchvision.models as models\nfrom efficientnet_pytorch import EfficientNet\n\ndef bn_drop_lin(n_in, n_out, bn=True, p = 0., actn = None):\n    \"`n_in`->bn->dropout->linear(`n_in`,`n_out`)->`actn`\"\n    layers = [nn.BatchNorm1d(n_in)] if bn else []\n    if p != 0: layers.append(nn.Dropout(p))\n    layers.append(nn.Linear(n_in, n_out))\n    if actn is not None: layers.append(actn)\n    return layers\n\nclass Head(nn.Module):\n    \"\"\"docstring for Head\"\"\"\n    def __init__(self, in_channels, out_channels, drop_rate = 0.5):\n        super(Head, self).__init__()\n        layers = bn_drop_lin(in_channels, 512, True, drop_rate, nn.ReLU(inplace=True)) +\\\n                    bn_drop_lin(512, out_channels, True, drop_rate)\n        self.fc = nn.Sequential(*layers)\n\n    def forward(self, x):\n        return self.fc(x)\n        \n\nclass MultiHeadNet(nn.Module):\n    def __init__(self, arch, pretrained, input_space = 'gray'):\n        super(MultiHeadNet, self).__init__()\n        # create model\n        print(\"=> creating model '{}'\".format(arch))\n        if arch.startswith('efficientnet'):\n            if pretrained.lower() not in ['false', 'none', 'not', 'no', '0']:\n                print(\"=> using pre-trained parameters '{}'\".format(pretrained))\n                model = EfficientNet.from_pretrained(arch)\n            else:\n                model = EfficientNet.from_name(arch)\n            # model._fc = nn.Linear(model._fc.in_features, 2)\n            in_features = model._fc.in_features\n            \n        else:\n            if pretrained.lower() not in ['false', 'none', 'not', 'no', '0']:\n                print(\"=> using pre-trained parameters '{}'\".format(pretrained))\n                model = pretrainedmodels.__dict__[arch](num_classes=1000,\n                                                             pretrained=pretrained)\n            else:\n                model = pretrainedmodels.__dict__[arch](num_classes=1000,\n                                                             pretrained=None)\n\n            # model.last_linear = nn.Linear(model.last_linear.in_features, 2)\n            in_features = model.last_linear.in_features\n\n        if input_space == 'gray':\n            if arch.startswith('resnet'):\n                model.conv1 = nn.Conv2d(1, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)\n            else:\n                print('Modify the input space.')\n\n        self.model = nn.Sequential(*(list(model.children())[:-1]))\n\n        self.head_graph = Head(in_features, 168)\n        self.head_vowel = Head(in_features, 11)\n        self.head_conso = Head(in_features, 7)\n\n\n\n    def forward(self, x):\n        x = self.model(x)\n        x = x.view(x.size(0), -1)\n        output_graph = self.head_graph(x)\n        output_vowel = self.head_vowel(x)\n        output_conso = self.head_conso(x)\n        return output_graph, output_vowel, output_conso\n\n\n\n\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"file_dir = './test_128.zip'\nzipFile = zipfile.ZipFile(file_dir)\nzipFile.extractall('test_128')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"from torchvision import transforms\nimport os\nimport pandas as pd\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.dataset import Dataset\nfrom torch.utils.data.sampler import *\nfrom torchvision import transforms\nfrom PIL import Image\n\nclass MyDataset(Dataset):\n    def __init__(self, img_dir, transform=None):\n        self.files = os.listdir(img_dir)\n        self.transform = transform\n        self.img_dir = img_dir\n \n    def __getitem__(self, index):\n        img_path = os.path.join(self.img_dir,'Test_'+str(index)+'.png')\n        img = Image.open(img_path)\n        if self.transform is not None:\n            img = self.transform(img)\n        return img, img_path\n \n    def __len__(self):\n        return len(self.files)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"val_augment = transforms.Compose([\n    # transforms.Resize((input_size,input_size)),\n    transforms.ToTensor(),\n    transforms.Normalize((img_avr,), (img_std,)),\n    ])\nIMAGE_DIR = './test_128'\ndataset  = MyDataset(IMAGE_DIR, val_augment)\ntest_loader = DataLoader(dataset,\n                        batch_size  = 32,\n                        drop_last   = False,\n                        num_workers = 4,\n                        pin_memory  = True)\n\n# plt.figure(\"Image\") # 图像窗口名称\n# plt.imshow(image)\nmodel = MultiHeadNet('resnet18', 'none')\nmodel = torch.nn.DataParallel(model).cuda()\nprint(model)\ncheckpoint = torch.load(\"/kaggle/input/checkpoint/checkpoint_epoch_006_macro_avg_recall_0.8878.pth\")\n# print(checkpoint)\nmodel.load_state_dict(checkpoint['state_dict'])\nmodel.eval()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"allpathes=[]\nallpreds_root = []\nallpreds_vowel = []\nallpreds_consonant = []\nfor step, (image,img_path) in enumerate(test_loader):\n    output_graph, output_vowel, output_conso = model(image)\n    preds_root = np.argmax(output_graph.cpu().detach().numpy(), axis=1)# 其中，axis=1表示按行计算\n    preds_vowel = np.argmax(output_vowel.cpu().detach().numpy(), axis=1)# 其中，axis=1表示按行计算\n    preds_consonant = np.argmax(output_conso.cpu().detach().numpy(), axis=1)# 其中，axis=1表示按行计算\n    allpathes.extend(img_path)\n    allpreds_root.extend(preds_root.tolist())\n    allpreds_vowel.extend(preds_vowel.tolist())\n    allpreds_consonant.extend(preds_consonant.tolist())\nprint(allpathes)\nprint(allpreds_root)\nprint(allpreds_vowel)\nprint(allpreds_consonant)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"row_id=[]\ntarget=[]\nfor idx, image_id in enumerate(allpathes):\n    target.extend([allpreds_consonant[idx]])\n    target.extend([allpreds_root[idx]])\n    target.extend([allpreds_vowel[idx]])\n\n    row_id.extend(['Test_'+str(idx) + '_consonant_diacritic'])\n    row_id.extend(['Test_'+str(idx) + '_grapheme_root'])\n    row_id.extend(['Test_'+str(idx) + '_vowel_diacritic'])\n\nprint(row_id)\nprint(target)\n# submission_df = pd.read_csv('../input/bengaliai-cv19/sample_submission.csv')\n#print(submission_df.shape)\n# print(len(target))\n# print(len(row_id))\n# print(target)\n# print(row_id)\ndf = pd.DataFrame(zip(row_id, target), columns=['row_id', 'target'])\n# submission_df.target = np.hstack(np.array(target).astype(np.int))\n#submission_df['target'] = np.array(target).astype(np.int)\n#submission_df['row_id'] = row_id\nprint(df.head(10))\ndf.to_csv('submission.csv', index=False)","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.7.4"},"widgets":{"application/vnd.jupyter.widget-state+json":{"state":{"043fdbc57d7849efb97f44f82008d15c":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"09d404cbbbba4f6e81ae1e8b9a2f71e6":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_e0a2f859c89a406cb55036978e67a54d","IPY_MODEL_0ec029d0aba744d4a3c8476ad3238f23"],"layout":"IPY_MODEL_bebc0d68f4324d24b19037871151b2fd"}},"0ec029d0aba744d4a3c8476ad3238f23":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_220323de2a354364b8fed6b43ec685d4","placeholder":"​","style":"IPY_MODEL_2f9e7e8e66a94fe4b25e5bdacbb4cc23","value":" 50210/50210 [01:27&lt;00:00, 574.05it/s]"}},"154751cf34d24ff998796f5cc34efabe":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"220323de2a354364b8fed6b43ec685d4":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"22afbde2337e4cff8933368d778acdc1":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"2f9e7e8e66a94fe4b25e5bdacbb4cc23":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"3576dae5283d401b9f38e380319dd960":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_d2df2067af3743619e732c05133fc921","IPY_MODEL_f1b57f4591944a6d88e05f7c2a389249"],"layout":"IPY_MODEL_e4811ab40c8b47eb8f3322806596a641"}},"3db6b126021b4643aa5ecb7a76b3e4f5":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"507eedca7f6a4a00940b5df628752d19":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"53d6381b196b404d9e5381a094b884da":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"558894b1dec8465c8c610919392e9484":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"6f53f753f2d44efa91d74f866fee648b":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8d5fa007771d40a38bda1c6077b49df3":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"90c29d8f4cfe48889c6ab7f1edbae359":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"IntProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"IntProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_b06d1f68806d4e9fa52c5acd7b178786","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_b2d3425f31ec4fbe88d0ebcfe9d3dd93","value":50210}},"9800ccc248fc4e1382455bcfa1fce72f":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"IntProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"IntProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_d1aed37ecfd84397a9fc378ae04f267f","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_dddfc4a0713b430a8c3afb5bc3c07ede","value":50210}},"9c43464a89bc4ab7a117a86fd743a4fc":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_90c29d8f4cfe48889c6ab7f1edbae359","IPY_MODEL_b8b95deb87d4496d87c34dee0a7ed707"],"layout":"IPY_MODEL_043fdbc57d7849efb97f44f82008d15c"}},"9e93ed6541af4fc8847730503a83c871":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_6f53f753f2d44efa91d74f866fee648b","placeholder":"​","style":"IPY_MODEL_53d6381b196b404d9e5381a094b884da","value":" 50210/50210 [01:32&lt;00:00, 540.69it/s]"}},"b06d1f68806d4e9fa52c5acd7b178786":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"b2d3425f31ec4fbe88d0ebcfe9d3dd93":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"b3f7e13cd4264dfcb8f5465c9dded2ee":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"b77611b55f59425c934ac2eed7d25861":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"b8b95deb87d4496d87c34dee0a7ed707":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_154751cf34d24ff998796f5cc34efabe","placeholder":"​","style":"IPY_MODEL_8d5fa007771d40a38bda1c6077b49df3","value":" 50210/50210 [01:25&lt;00:00, 583.88it/s]"}},"bebc0d68f4324d24b19037871151b2fd":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"c5b9049ef337491e956f7ff74e384602":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_9800ccc248fc4e1382455bcfa1fce72f","IPY_MODEL_9e93ed6541af4fc8847730503a83c871"],"layout":"IPY_MODEL_3db6b126021b4643aa5ecb7a76b3e4f5"}},"d12868fd7ea74e17921b18bd6cb67db3":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d1aed37ecfd84397a9fc378ae04f267f":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d2df2067af3743619e732c05133fc921":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"IntProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"IntProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_d12868fd7ea74e17921b18bd6cb67db3","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_558894b1dec8465c8c610919392e9484","value":50210}},"dddfc4a0713b430a8c3afb5bc3c07ede":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"e0a2f859c89a406cb55036978e67a54d":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"IntProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"IntProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_507eedca7f6a4a00940b5df628752d19","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_22afbde2337e4cff8933368d778acdc1","value":50210}},"e4811ab40c8b47eb8f3322806596a641":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f1b57f4591944a6d88e05f7c2a389249":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_b3f7e13cd4264dfcb8f5465c9dded2ee","placeholder":"​","style":"IPY_MODEL_b77611b55f59425c934ac2eed7d25861","value":" 50210/50210 [01:36&lt;00:00, 519.22it/s]"}}},"version_major":2,"version_minor":0}}},"nbformat":4,"nbformat_minor":1}