{"cells":[{"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5"},"cell_type":"markdown","source":"# Description\n\nIn a lot of kernels I see that when doing preprocessing or postprocessing we use regular single proces way of coding. A lot of times it takes only a few extra lines of code to implement multiprocessing and get a nice performance boost.\n\nWhen we do deeplearning we want it to run as fast as possible with parallel processes on a GPU. So why not also use parallel processes for the pre- or postprocessing parts that we implement.\n\nTo show you that it is quitte easy I will use the preprocessing code as was written in this very nice [kernel](https://www.kaggle.com/iafoss/image-preprocessing-128x128). We will take a look at the performance difference when running it with multiprocessing.\n\nNote that you should be able to just modify this kernel to run your own pre- or postprocessing code.\n\nAnd if you like the kernel then I would appreciate an upvote."},{"metadata":{"trusted":false},"cell_type":"code","source":"import cv2\nimport gc\nimport io\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport time\nfrom tqdm import tqdm_notebook as tqdm\nimport zipfile\nimport warnings\nwarnings.filterwarnings(\"ignore\")","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"To implement support for multi-processing we need to import the multiprocessing module."},{"metadata":{"trusted":false},"cell_type":"code","source":"# To support Multiprocessing\nimport multiprocessing","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Next the image preprocessing code as mentioned from the referenced kernel."},{"metadata":{"trusted":false},"cell_type":"code","source":"HEIGHT = 137\nWIDTH = 236\nSIZE = 128\n\nTRAIN = ['/kaggle/input/bengaliai-cv19/train_image_data_0.parquet',\n         '/kaggle/input/bengaliai-cv19/train_image_data_1.parquet',\n         '/kaggle/input/bengaliai-cv19/train_image_data_2.parquet',\n         '/kaggle/input/bengaliai-cv19/train_image_data_3.parquet']","execution_count":null,"outputs":[]},{"metadata":{"trusted":false},"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    \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    \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    \n    # Remove low intensity pixels as noise\n    img[img < 28] = 0\n    lx, ly = xmax-xmin,ymax-ymin\n    l = max(lx,ly) + pad\n    \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    \n    return cv2.resize(img, (size, size))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Single process\nFirst lets run the preprocessing in the standard single process way and see what the processing time is."},{"metadata":{"trusted":true},"cell_type":"code","source":"# Start timer\nstart_time = time.time()\n\nwith zipfile.ZipFile('train_single.zip', 'w') as img_out:\n    for fname in TRAIN:\n        # Read parquet file into pandas.\n        df = pd.read_parquet(fname)\n        \n        # The input 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            \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            img = cv2.imencode('.png',img)[1]\n            img_out.writestr(name + '.png', img)\n            \n# Total time\nprint('Processing time standard: {0} [sec]'.format(time.time() - start_time))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We can see that looping over the training input files and processing each file separately takes roughlybetween 500-600 seconds. Note that this can vary slightly with each run."},{"metadata":{},"cell_type":"markdown","source":"# Multiprocess Version 1\nLets explore a first version of multiprocessing. Here we will loop over the train input files and process all the images in parallel processes. As an end result all the processed images will be added to the final zip file.\n\nFor setting up an effective multiprocessing code it is also import to take into account how much CPU cores are available, whats the available memory and also the disksubsystem. As a general guideline you can take the number of CPU cores as the number of processes that can run in parallel. If the CPU supports HyperTreading then you might get a small benefit by doubling the number of processes. However it does not always work. Some experimentation could be required ;-)\n\nTo use multiprocessing I define a function 'process_image_multi_v1'. It performs the complete processing for 1 image in combination with the earlier defined preprocessing functions."},{"metadata":{"trusted":false},"cell_type":"code","source":"def process_image_multi_v1(data, name):\n    # Reshape data\n    data = data.reshape(HEIGHT, WIDTH)\n    \n    # Normalize each image by its max val\n    data = 255 - data.astype(np.uint8)\n    img = (data*(255.0/data.max())).astype(np.uint8)\n    \n    # Crop, Resize and encode as PNG file\n    img = crop_resize(img)\n    img = cv2.imencode('.png',img)[1]\n    \n    return name, img","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Verify and get the CPU count. We will use the cpu_count to specify the number of parallel processes."},{"metadata":{"trusted":false},"cell_type":"code","source":"# CPU core count\ncpu_count = multiprocessing.cpu_count()\nprint(cpu_count)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Next we setup the multiprocessing pool. With pool.starmap we can send multiple iterable variables to the function 'process_image_multi_v1'. For each process that returns a processed image the name and image are used to write them to the output zip file."},{"metadata":{"trusted":false},"cell_type":"code","source":"# Start Multi Processing\nstart_multi_time_v1 = time.time()\n\ntry:\n    # Setup multiprocessing pool\n    pool = multiprocessing.Pool(processes = cpu_count)\n\n    with zipfile.ZipFile('train_multi.zip', 'w') as img_out:\n        for fname in TRAIN:\n            # Read Parquet file\n            df = pd.read_parquet(fname)\n            \n            # Prep the input for pool.starmap.\n            data = df.iloc[:, 1:].values\n            names = df.image_id.tolist()\n\n            for name, img in pool.starmap(process_image_multi_v1, zip(data, names)):\n                img_out.writestr(name + '.png', img)\n\nfinally:\n    pool.close()\n    pool.join()\n\n# Total time\nprint('Processing time multi v1: {0} [sec]'.format(time.time() - start_multi_time_v1))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We can see that there is a significant increase in performance by cutting down the required processing time because all images are processed in parallel."},{"metadata":{},"cell_type":"markdown","source":"# Multiprocess Version 2\nLets also explore a second option. This time we won't write to the final output .zip file but we will write each image directly to an output directory. This might save a little overhead for each process."},{"metadata":{"trusted":false},"cell_type":"code","source":"def process_image_multi_v2(data, name):\n    # Reshape data\n    data = data.reshape(HEIGHT, WIDTH)\n    \n    # Normalize each image by its max val\n    data = 255 - data.astype(np.uint8)\n    img = (data*(255.0/data.max())).astype(np.uint8)\n    \n    # Crop, Resize and encode as PNG file\n    img = crop_resize(img)\n    img = cv2.imencode('.png',img)[1]\n    \n    # Save image\n    cv2.imwrite('./subdir/' + name + '.png', img)\n    \n# Start Multi Processing\nstart_multi_time_v2 = time.time()\n\ntry:\n    pool = multiprocessing.Pool(processes = cpu_count)\n\n    # Process Images Standard.\n    for fname in TRAIN:\n        # Read Parquet file\n        df = pd.read_parquet(fname)\n\n        # Invert the input\n        data = df.iloc[:, 1:].values\n        names = df.image_id.tolist()\n        \n        # Multi Process Images\n        pool.starmap(process_image_multi_v2, zip(data, names))\n\nfinally:\n    pool.close()\n    pool.join()\n\n# Total time\nprint('Processing time multi v2: {0} [sec]'.format(time.time() - start_multi_time_v2))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"As you can see we achieved a nice performance gain by cutting down the total processing times. May'be you would expect more in performance gain. However we have to take into account the time required for the loading of the train input files. This takes some amount of time.\n\nI hope I showed a little of the benefits of using multiprocessing. With some tweaking you can just replace the existing preprocessing code and put in your own code. \n\nIf you have any questions or remarks I'am always happy to help."}],"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.6.6"},"widgets":{"application/vnd.jupyter.widget-state+json":{"state":{"00037f9aa7d34d5195253d0281476f6b":{"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"}},"09d09deffcde4145a4306c504560ca2b":{"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}},"18302be686b74690b87e4da501d1f208":{"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_5a4dbf8de4cf45da962772a508ad5c0a","placeholder":"​","style":"IPY_MODEL_a0b0f9a879064506ad86404ffbf8ce69","value":" 50210/50210 [01:34&lt;00:00, 531.89it/s]"}},"1d0154438e3743d9bb0764064291b901":{"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}},"2ce3ceb4ab4d4d648bfeb738138e7330":{"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":""}},"2e42adf105ba40eb8b3d2a557aec8a60":{"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"}},"3193885fa51e4299ae5fe5cf3b8ec765":{"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_d485434c670d411f9a4804b4fa6af4e1","IPY_MODEL_7b0fd90430de4683831892af37fd8d0a"],"layout":"IPY_MODEL_7ef544d01f2f453aa2ef62ce684f3e57"}},"32efbaad9f6a43feaf33433493730f0b":{"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":""}},"47a2aae0102445849d4c201c010b82db":{"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}},"4a07ee5c2fc54bc9a41002e73beb4e47":{"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_47a2aae0102445849d4c201c010b82db","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_63a38e66bfe94b12bcac600a01af4f1f","value":50210}},"5a022af72e1d48dc978d5356d12581d6":{"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}},"5a4dbf8de4cf45da962772a508ad5c0a":{"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}},"63a38e66bfe94b12bcac600a01af4f1f":{"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"}},"6414bdd8c67144b581358cb08ff06f0d":{"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}},"6481afc2214d44f39fae572e0a39ee1b":{"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}},"6b2765e6c5034cb9967e0e3ce378877c":{"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_1d0154438e3743d9bb0764064291b901","placeholder":"​","style":"IPY_MODEL_2ce3ceb4ab4d4d648bfeb738138e7330","value":" 50210/50210 [01:30&lt;00:00, 554.15it/s]"}},"7308730a9f63458ea744d651835d04b9":{"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"}},"7a99967ce22a4e75b4f4e7cdd5f3cd34":{"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_a2399f87c3404613a2d5bb7e6a8b83be","placeholder":"​","style":"IPY_MODEL_32efbaad9f6a43feaf33433493730f0b","value":" 50210/50210 [01:13&lt;00:00, 678.79it/s]"}},"7b0fd90430de4683831892af37fd8d0a":{"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_dc5a0a674f5b43b0a1ff63db5e0e6c94","placeholder":"​","style":"IPY_MODEL_97c5d7eb76164f478e4baa802090cd63","value":" 50210/50210 [00:52&lt;00:00, 948.62it/s]"}},"7ef544d01f2f453aa2ef62ce684f3e57":{"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}},"87981f32c3f14920b08e2e77bec089a0":{"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}},"8c7098f05800459b885a87bcde914d5c":{"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_4a07ee5c2fc54bc9a41002e73beb4e47","IPY_MODEL_18302be686b74690b87e4da501d1f208"],"layout":"IPY_MODEL_09d09deffcde4145a4306c504560ca2b"}},"97c5d7eb76164f478e4baa802090cd63":{"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":""}},"a0b0f9a879064506ad86404ffbf8ce69":{"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":""}},"a2399f87c3404613a2d5bb7e6a8b83be":{"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}},"a3662d473668411cb13d74ebe0d39e13":{"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_6414bdd8c67144b581358cb08ff06f0d","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_00037f9aa7d34d5195253d0281476f6b","value":50210}},"c01d7a5ed595432fb8aa544e7f9b7d65":{"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}},"d2829d0bf9dc4a498023624b986fe2dd":{"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_d3755dfb316f4e54824fcc4a8f4fd697","IPY_MODEL_6b2765e6c5034cb9967e0e3ce378877c"],"layout":"IPY_MODEL_5a022af72e1d48dc978d5356d12581d6"}},"d3755dfb316f4e54824fcc4a8f4fd697":{"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_87981f32c3f14920b08e2e77bec089a0","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_7308730a9f63458ea744d651835d04b9","value":50210}},"d4599c98595e4a7792f3fd9f09d6467e":{"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_a3662d473668411cb13d74ebe0d39e13","IPY_MODEL_7a99967ce22a4e75b4f4e7cdd5f3cd34"],"layout":"IPY_MODEL_6481afc2214d44f39fae572e0a39ee1b"}},"d485434c670d411f9a4804b4fa6af4e1":{"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_c01d7a5ed595432fb8aa544e7f9b7d65","max":50210,"min":0,"orientation":"horizontal","style":"IPY_MODEL_2e42adf105ba40eb8b3d2a557aec8a60","value":50210}},"dc5a0a674f5b43b0a1ff63db5e0e6c94":{"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}}},"version_major":2,"version_minor":0}}},"nbformat":4,"nbformat_minor":1}