Skip to content

Instantly share code, notes, and snippets.

@sujnesh
Created February 25, 2021 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sujnesh/e827e801df0887df0473ab515e7abc58 to your computer and use it in GitHub Desktop.
Save sujnesh/e827e801df0887df0473ab515e7abc58 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Baseline-Hey-Barrels","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyMWR38oV3f8H/NX0EJcLpWl"},"kernelspec":{"name":"python3","display_name":"Python 3"},"widgets":{"application/vnd.jupyter.widget-state+json":{"c58e9a0318cc4e64878cad16f598c81a":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","state":{"_view_name":"HBoxView","_dom_classes":[],"_model_name":"HBoxModel","_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.5.0","box_style":"","layout":"IPY_MODEL_5fff720bfd6b45198cc63a4b87de61df","_model_module":"@jupyter-widgets/controls","children":["IPY_MODEL_d8f3df3cffef40ec89406b4b6d38944d","IPY_MODEL_4f0fdac91be7447989717b03c7f4427e"]}},"5fff720bfd6b45198cc63a4b87de61df":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"d8f3df3cffef40ec89406b4b6d38944d":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","state":{"_view_name":"ProgressView","style":"IPY_MODEL_413504f1812740869e1826e3127ff25d","_dom_classes":[],"description":"train.zip: 100%","_model_name":"FloatProgressModel","bar_style":"success","max":494614984,"_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","value":494614984,"_view_count":null,"_view_module_version":"1.5.0","orientation":"horizontal","min":0,"description_tooltip":null,"_model_module":"@jupyter-widgets/controls","layout":"IPY_MODEL_4a0bfa90c9e346e8b9ac30f4a1c4511b"}},"4f0fdac91be7447989717b03c7f4427e":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","state":{"_view_name":"HTMLView","style":"IPY_MODEL_6027f67f30634df8a51f079234408f69","_dom_classes":[],"description":"","_model_name":"HTMLModel","placeholder":"​","_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","value":" 495M/495M [00:25&lt;00:00, 19.3MB/s]","_view_count":null,"_view_module_version":"1.5.0","description_tooltip":null,"_model_module":"@jupyter-widgets/controls","layout":"IPY_MODEL_be5f34a435c74d20b775c69969ffaa25"}},"413504f1812740869e1826e3127ff25d":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","state":{"_view_name":"StyleView","_model_name":"ProgressStyleModel","description_width":"initial","_view_module":"@jupyter-widgets/base","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.2.0","bar_color":null,"_model_module":"@jupyter-widgets/controls"}},"4a0bfa90c9e346e8b9ac30f4a1c4511b":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"6027f67f30634df8a51f079234408f69":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","state":{"_view_name":"StyleView","_model_name":"DescriptionStyleModel","description_width":"","_view_module":"@jupyter-widgets/base","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.2.0","_model_module":"@jupyter-widgets/controls"}},"be5f34a435c74d20b775c69969ffaa25":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"07d06feab0a142338435de53823681f9":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","state":{"_view_name":"HBoxView","_dom_classes":[],"_model_name":"HBoxModel","_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.5.0","box_style":"","layout":"IPY_MODEL_763f0428d1b8488a85bdddf5987758f0","_model_module":"@jupyter-widgets/controls","children":["IPY_MODEL_53cd5c87339148859482562c68dd5ac4","IPY_MODEL_6a218fafbd3c4487823a89fe281ece92"]}},"763f0428d1b8488a85bdddf5987758f0":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"53cd5c87339148859482562c68dd5ac4":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","state":{"_view_name":"ProgressView","style":"IPY_MODEL_e9f31623b5244d60a70292c9c46ccc48","_dom_classes":[],"description":"test.zip: 100%","_model_name":"FloatProgressModel","bar_style":"success","max":485964351,"_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","value":485964351,"_view_count":null,"_view_module_version":"1.5.0","orientation":"horizontal","min":0,"description_tooltip":null,"_model_module":"@jupyter-widgets/controls","layout":"IPY_MODEL_b6138336ee3e4bcf8acf75e6aaf0d7e1"}},"6a218fafbd3c4487823a89fe281ece92":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","state":{"_view_name":"HTMLView","style":"IPY_MODEL_4e10252b58b446dc887f6b04d13c0ed7","_dom_classes":[],"description":"","_model_name":"HTMLModel","placeholder":"​","_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","value":" 486M/486M [00:25&lt;00:00, 18.9MB/s]","_view_count":null,"_view_module_version":"1.5.0","description_tooltip":null,"_model_module":"@jupyter-widgets/controls","layout":"IPY_MODEL_d1f02dcce70240f9acf2f3a018b43fdd"}},"e9f31623b5244d60a70292c9c46ccc48":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","state":{"_view_name":"StyleView","_model_name":"ProgressStyleModel","description_width":"initial","_view_module":"@jupyter-widgets/base","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.2.0","bar_color":null,"_model_module":"@jupyter-widgets/controls"}},"b6138336ee3e4bcf8acf75e6aaf0d7e1":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"4e10252b58b446dc887f6b04d13c0ed7":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","state":{"_view_name":"StyleView","_model_name":"DescriptionStyleModel","description_width":"","_view_module":"@jupyter-widgets/base","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.2.0","_model_module":"@jupyter-widgets/controls"}},"d1f02dcce70240f9acf2f3a018b43fdd":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"514001a5a088426c9d4ed79659ed1619":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","state":{"_view_name":"HBoxView","_dom_classes":[],"_model_name":"HBoxModel","_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.5.0","box_style":"","layout":"IPY_MODEL_b7d4c9dbba364553aa541182ef1496e1","_model_module":"@jupyter-widgets/controls","children":["IPY_MODEL_82bf7ead5fcc421ca7fa457da855b3da","IPY_MODEL_9f0d74a7ecfc48cf8ebb607ea54a2a9b"]}},"b7d4c9dbba364553aa541182ef1496e1":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"82bf7ead5fcc421ca7fa457da855b3da":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","state":{"_view_name":"ProgressView","style":"IPY_MODEL_56c028a3a9af4b309bbfd6bce2dd304e","_dom_classes":[],"description":"example_submission.csv: 100%","_model_name":"FloatProgressModel","bar_style":"success","max":7446,"_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","value":7446,"_view_count":null,"_view_module_version":"1.5.0","orientation":"horizontal","min":0,"description_tooltip":null,"_model_module":"@jupyter-widgets/controls","layout":"IPY_MODEL_8ea0203b341440028934df376a1b1036"}},"9f0d74a7ecfc48cf8ebb607ea54a2a9b":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","state":{"_view_name":"HTMLView","style":"IPY_MODEL_fb5fd8f3e2d14925bdd961846bd74297","_dom_classes":[],"description":"","_model_name":"HTMLModel","placeholder":"​","_view_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","value":" 7.45k/7.45k [00:25&lt;00:00, 290B/s]","_view_count":null,"_view_module_version":"1.5.0","description_tooltip":null,"_model_module":"@jupyter-widgets/controls","layout":"IPY_MODEL_2bea240b316241bdaae18b0bad901996"}},"56c028a3a9af4b309bbfd6bce2dd304e":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","state":{"_view_name":"StyleView","_model_name":"ProgressStyleModel","description_width":"initial","_view_module":"@jupyter-widgets/base","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.2.0","bar_color":null,"_model_module":"@jupyter-widgets/controls"}},"8ea0203b341440028934df376a1b1036":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"fb5fd8f3e2d14925bdd961846bd74297":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","state":{"_view_name":"StyleView","_model_name":"DescriptionStyleModel","description_width":"","_view_module":"@jupyter-widgets/base","_model_module_version":"1.5.0","_view_count":null,"_view_module_version":"1.2.0","_model_module":"@jupyter-widgets/controls"}},"2bea240b316241bdaae18b0bad901996":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}},"7c7f7e97f86a43c9b3ae1bbb42c17e43":{"model_module":"@jupyter-widgets/output","model_name":"OutputModel","state":{"_view_name":"OutputView","msg_id":"","_dom_classes":[],"_model_name":"OutputModel","outputs":[{"output_type":"display_data","metadata":{"tags":[]},"text/html":"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">submission.csv</span> <span style=\"color: #729c1f; text-decoration-color: #729c1f\">━━━━━━━━━━━━━━━━━━━━━━━</span> <span style=\"color: #800080; text-decoration-color: #800080\">100.0%</span> • <span style=\"color: #008000; text-decoration-color: #008000\">9.2/7.6 KB</span> • <span style=\"color: #800000; text-decoration-color: #800000\">60.6 kB/s</span> • <span style=\"color: #008080; text-decoration-color: #008080\">0:00:00</span>\n</pre>\n","text/plain":"<rich.jupyter.JupyterRenderable at 0x7f85c15d5b10>"}],"_view_module":"@jupyter-widgets/output","_model_module_version":"1.0.0","_view_count":null,"_view_module_version":"1.0.0","layout":"IPY_MODEL_62588072e86342738ec5f85ef12dcda7","_model_module":"@jupyter-widgets/output"}},"62588072e86342738ec5f85ef12dcda7":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","state":{"_view_name":"LayoutView","grid_template_rows":null,"right":null,"justify_content":null,"_view_module":"@jupyter-widgets/base","overflow":null,"_model_module_version":"1.2.0","_view_count":null,"flex_flow":null,"width":null,"min_width":null,"border":null,"align_items":null,"bottom":null,"_model_module":"@jupyter-widgets/base","top":null,"grid_column":null,"overflow_y":null,"overflow_x":null,"grid_auto_flow":null,"grid_area":null,"grid_template_columns":null,"flex":null,"_model_name":"LayoutModel","justify_items":null,"grid_row":null,"max_height":null,"align_content":null,"visibility":null,"align_self":null,"height":null,"min_height":null,"padding":null,"grid_auto_rows":null,"grid_gap":null,"max_width":null,"order":null,"_view_module_version":"1.2.0","grid_template_areas":null,"object_position":null,"object_fit":null,"grid_auto_columns":null,"margin":null,"display":null,"left":null}}}}},"cells":[{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"RgWKZbYuh6u2","executionInfo":{"status":"ok","timestamp":1614255834581,"user_tz":-330,"elapsed":12320,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}},"outputId":"73802eee-809d-4f12-d6fe-c7292c6f33d8"},"source":["from pathlib import Path\n","\n","import tensorflow as tf\n","import cv2 as cv\n","import pandas as pd\n","import numpy as np\n","\n","!pip install git+https://gitlab.aicrowd.com/aicrowd/aicrowd-cli.git >/dev/null\n","%load_ext aicrowd.magic"],"execution_count":1,"outputs":[{"output_type":"stream","text":[" Running command git clone -q https://gitlab.aicrowd.com/aicrowd/aicrowd-cli.git /tmp/pip-req-build-u91h4e3d\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"t7BzKfabbyCJ","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1614255835136,"user_tz":-330,"elapsed":12865,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}},"outputId":"14929ee5-8100-4c9f-f33e-6167d010df8e"},"source":["API_KEY = \"\" # Please enter your API Key [https://www.aicrowd.com/participants/me]\n","%aicrowd login --api-key $API_KEY"],"execution_count":2,"outputs":[{"output_type":"stream","text":["\u001b[32mAPI Key valid\u001b[0m\n","\u001b[32mSaved API Key successfully!\u001b[0m\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"JRLVLj8UiTbn","colab":{"base_uri":"https://localhost:8080/","height":304,"referenced_widgets":["c58e9a0318cc4e64878cad16f598c81a","5fff720bfd6b45198cc63a4b87de61df","d8f3df3cffef40ec89406b4b6d38944d","4f0fdac91be7447989717b03c7f4427e","413504f1812740869e1826e3127ff25d","4a0bfa90c9e346e8b9ac30f4a1c4511b","6027f67f30634df8a51f079234408f69","be5f34a435c74d20b775c69969ffaa25","07d06feab0a142338435de53823681f9","763f0428d1b8488a85bdddf5987758f0","53cd5c87339148859482562c68dd5ac4","6a218fafbd3c4487823a89fe281ece92","e9f31623b5244d60a70292c9c46ccc48","b6138336ee3e4bcf8acf75e6aaf0d7e1","4e10252b58b446dc887f6b04d13c0ed7","d1f02dcce70240f9acf2f3a018b43fdd","514001a5a088426c9d4ed79659ed1619","b7d4c9dbba364553aa541182ef1496e1","82bf7ead5fcc421ca7fa457da855b3da","9f0d74a7ecfc48cf8ebb607ea54a2a9b","56c028a3a9af4b309bbfd6bce2dd304e","8ea0203b341440028934df376a1b1036","fb5fd8f3e2d14925bdd961846bd74297","2bea240b316241bdaae18b0bad901996"]},"executionInfo":{"status":"ok","timestamp":1614255854054,"user_tz":-330,"elapsed":31772,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}},"outputId":"275f7bf3-cde9-401c-cc2d-86875df839cc"},"source":["%aicrowd dataset list -c hey-barrels\n","%aicrowd dataset download -c hey-barrels -j 3\n","\n","!unzip train.zip >/dev/null\n","!unzip test.zip >/dev/null"],"execution_count":3,"outputs":[{"output_type":"stream","text":[" Datasets for challenge #750 \n","┌───┬────────────────────────┬─────────────┬───────────┐ \n","│ # │ Title │ Description │ Size │ \n","├───┼────────────────────────┼─────────────┼───────────┤ \n","│ 0 │ example_submission.csv │ - │ 7.45 KB │ \n","│ 1 │ test.zip │ - │ 485.96 MB │ \n","│ 2 │ train.zip │ - │ 494.61 MB │ \n","└───┴────────────────────────┴─────────────┴───────────┘ \n"],"name":"stdout"},{"output_type":"display_data","data":{"application/vnd.jupyter.widget-view+json":{"model_id":"c58e9a0318cc4e64878cad16f598c81a","version_minor":0,"version_major":2},"text/plain":["HBox(children=(FloatProgress(value=0.0, description='train.zip', max=494614984.0, style=ProgressStyle(descript…"]},"metadata":{"tags":[]}},{"output_type":"display_data","data":{"application/vnd.jupyter.widget-view+json":{"model_id":"07d06feab0a142338435de53823681f9","version_minor":0,"version_major":2},"text/plain":["HBox(children=(FloatProgress(value=0.0, description='test.zip', max=485964351.0, style=ProgressStyle(descripti…"]},"metadata":{"tags":[]}},{"output_type":"display_data","data":{"application/vnd.jupyter.widget-view+json":{"model_id":"514001a5a088426c9d4ed79659ed1619","version_minor":0,"version_major":2},"text/plain":["HBox(children=(FloatProgress(value=0.0, description='example_submission.csv', max=7446.0, style=ProgressStyle(…"]},"metadata":{"tags":[]}},{"output_type":"stream","text":["\n","\n","\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"8LYOfgJHcScc","executionInfo":{"status":"ok","timestamp":1614255854058,"user_tz":-330,"elapsed":31769,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["TRAIN_DATA_DIR = \"train/images\"\n","TRAIN_LABELS = \"train/meta-data.csv\"\n","TEST_DATA_DIR = \"test\""],"execution_count":4,"outputs":[]},{"cell_type":"code","metadata":{"id":"D7Q5sm6npKTO","executionInfo":{"status":"ok","timestamp":1614255865254,"user_tz":-330,"elapsed":42961,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["TRAIN_DATA = {}\n","for im in Path(TRAIN_DATA_DIR).iterdir():\n"," # scale down image\n"," TRAIN_DATA[im.name] = cv.resize(cv.imread(str(im), 0), (150, 200)).flatten()"],"execution_count":5,"outputs":[]},{"cell_type":"code","metadata":{"id":"nd8Uzk8VkkZk","executionInfo":{"status":"ok","timestamp":1614255865256,"user_tz":-330,"elapsed":42959,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["X = np.array(list(TRAIN_DATA.values()))"],"execution_count":6,"outputs":[]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":237},"id":"A_-hb_1LhJi7","executionInfo":{"status":"ok","timestamp":1614255865258,"user_tz":-330,"elapsed":42956,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}},"outputId":"e2aab405-82f6-4c8c-8ba1-20e9de003fed"},"source":["Y = pd.read_csv(TRAIN_LABELS, index_col=\"filename\").reindex(TRAIN_DATA.keys())\n","Y.head()"],"execution_count":7,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>barrels_count</th>\n"," <th>pigs_count</th>\n"," </tr>\n"," <tr>\n"," <th>filename</th>\n"," <th></th>\n"," <th></th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0130.png</th>\n"," <td>10</td>\n"," <td>10</td>\n"," </tr>\n"," <tr>\n"," <th>0078.png</th>\n"," <td>7</td>\n"," <td>8</td>\n"," </tr>\n"," <tr>\n"," <th>0465.png</th>\n"," <td>12</td>\n"," <td>8</td>\n"," </tr>\n"," <tr>\n"," <th>0436.png</th>\n"," <td>11</td>\n"," <td>5</td>\n"," </tr>\n"," <tr>\n"," <th>0175.png</th>\n"," <td>9</td>\n"," <td>9</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>"],"text/plain":[" barrels_count pigs_count\n","filename \n","0130.png 10 10\n","0078.png 7 8\n","0465.png 12 8\n","0436.png 11 5\n","0175.png 9 9"]},"metadata":{"tags":[]},"execution_count":7}]},{"cell_type":"code","metadata":{"id":"YFYO5YT5eP8S","executionInfo":{"status":"ok","timestamp":1614255868623,"user_tz":-330,"elapsed":46318,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["model = tf.keras.Sequential([\n"," tf.keras.Input(shape=(150*200)),\n"," tf.keras.layers.Dense(8192),\n"," tf.keras.layers.Dense(512),\n"," tf.keras.layers.Dense(2),\n","])\n","model.compile(loss=\"mean_squared_error\", optimizer=tf.keras.optimizers.Adam(learning_rate=0.001))"],"execution_count":8,"outputs":[]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"fuECeYyNfL9b","executionInfo":{"status":"ok","timestamp":1614255965886,"user_tz":-330,"elapsed":143575,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}},"outputId":"8d351000-8c51-4cb1-a973-9b16bbecfaba"},"source":["model.fit(x=X, y=Y.values, epochs=5)"],"execution_count":9,"outputs":[{"output_type":"stream","text":["Epoch 1/5\n","16/16 [==============================] - 20s 1s/step - loss: 6367730860.3076\n","Epoch 2/5\n","16/16 [==============================] - 19s 1s/step - loss: 665434505.4118\n","Epoch 3/5\n","16/16 [==============================] - 19s 1s/step - loss: 64884318.1176\n","Epoch 4/5\n","16/16 [==============================] - 19s 1s/step - loss: 18244301.8824\n","Epoch 5/5\n","16/16 [==============================] - 19s 1s/step - loss: 5015027.9412\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/plain":["<tensorflow.python.keras.callbacks.History at 0x7f85c15b7b90>"]},"metadata":{"tags":[]},"execution_count":9}]},{"cell_type":"code","metadata":{"id":"vhdcAjB1pPBE","executionInfo":{"status":"ok","timestamp":1614255976486,"user_tz":-330,"elapsed":154171,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["TEST_DATA = {}\n","for im in Path(TEST_DATA_DIR).iterdir():\n"," # scale down image\n"," TEST_DATA[im.name] = cv.resize(cv.imread(str(im), 0), (150, 200)).flatten()\n","\n","X_test = np.array(list(TEST_DATA.values()))"],"execution_count":10,"outputs":[]},{"cell_type":"code","metadata":{"id":"wRN4H-dxqO52","executionInfo":{"status":"ok","timestamp":1614255981416,"user_tz":-330,"elapsed":159098,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["y_test = model.predict(X_test)\n","# we cant have -ve sheeps and barrels...\n","y_test[y_test < 0] = 0\n","# ...or a fractional number of them\n","y_test = y_test.astype(\"int\")"],"execution_count":11,"outputs":[]},{"cell_type":"code","metadata":{"id":"UvYV4JBAsFDU","executionInfo":{"status":"ok","timestamp":1614256305458,"user_tz":-330,"elapsed":726,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}}},"source":["submission = pd.DataFrame(zip(TEST_DATA.keys(), y_test[:,0], y_test[:,1]), columns=[\"filename\", \"barrels_count\", \"pigs_count\"]).sort_values(\"filename\")\n","submission.to_csv(\"submission.csv\", index=False)"],"execution_count":16,"outputs":[]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":312,"referenced_widgets":["7c7f7e97f86a43c9b3ae1bbb42c17e43","62588072e86342738ec5f85ef12dcda7"]},"id":"XQnoSNMYtEXA","executionInfo":{"status":"ok","timestamp":1614256586380,"user_tz":-330,"elapsed":4589,"user":{"displayName":"Yoogottam Khandelwal","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GicdRVYHtughdCUKxCiqQZ2s7GgGOIyXBbfo8qdgw=s64","userId":"08735518521068377469"}},"outputId":"f41fd2c5-92bf-4caa-8451-672ad0014e14"},"source":["%aicrowd submission create -c hey-barrels -f submission.csv"],"execution_count":19,"outputs":[{"output_type":"display_data","data":{"application/vnd.jupyter.widget-view+json":{"model_id":"7c7f7e97f86a43c9b3ae1bbb42c17e43","version_minor":0,"version_major":2},"text/plain":["Output()"]},"metadata":{"tags":[]}},{"output_type":"stream","text":[" ╭─────────────────────────╮ \n"," │ Successfully submitted! │ \n"," ╰─────────────────────────╯ \n"," Important links \n","┌──────────────────┬────────────────────────────────────────────────────────────────────────────────────┐\n","│ This submission │ https://www.aicrowd.com/challenges/ml-battleground/submissions/123272 │\n","│ │ │\n","│ All submissions │ https://www.aicrowd.com/challenges/ml-battleground/submissions?my_submissions=true │\n","│ │ │\n","│ Leaderboard │ https://www.aicrowd.com/challenges/ml-battleground/leaderboards │\n","│ │ │\n","│ Discussion forum │ https://discourse.aicrowd.com/c/ml-battleground │\n","│ │ │\n","│ Challenge page │ https://www.aicrowd.com/challenges/ml-battleground │\n","└──────────────────┴────────────────────────────────────────────────────────────────────────────────────┘\n","{'submission_id': 123272, 'created_at': '2021-02-25T12:36:25.684Z'}\n"],"name":"stdout"}]}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment