{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"70bfa5d9-3551-1eb5-c8f6-601c22abf10f"},"outputs":[],"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 the files in the input directory\n\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"7de4a480-0966-d042-2a7a-238fb953b6db"},"outputs":[],"source":"from shapely.wkt import loads as wkt_loads\nfrom matplotlib.patches import Polygon, Patch\nfrom descartes.patch import PolygonPatch\nimport matplotlib.pyplot as plt\nimport tifffile as tiff\nimport pylab\n\ninDir = '../input'\nCLASSES = {\n    1 : 'Bldg',\n    2 : 'Struct',\n    3 : 'Road',\n    4 : 'Track',\n    5 : 'Trees',\n    6 : 'Crops',\n    7 : 'Fast H20',\n    8 : 'Slow H20',\n    9 : 'Truck',\n    10 : 'Car',\n}\n\nCOLORS = {\n    1 : '0.7',\n    2 : '0.4',\n    3 : '#b35806',\n    4 : '#dfc27d',\n    5 : '#1b7837',\n    6 : '#a6dba0',\n    7 : '#74add1',\n    8 : '#4575b4',\n    9 : '#f46d43',\n    10: '#d73027',\n}\n\nZORDER = {\n    1 : 5,\n    2 : 5,\n    3 : 4,\n    4 : 1,\n    5 : 3,\n    6 : 2,\n    7 : 7,\n    8 : 8,\n    9 : 9,\n    10 : 10,\n}\n\ndf = pd.read_csv(inDir + '/train_wkt_v4.csv')\nprint(df.head())\ngs = pd.read_csv(inDir + '/grid_sizes.csv', names=['ImageId', 'Xmas', 'Ymin'], skiprows=1)\nprint(gs.head())\n\nallImageIds = gs.ImageId.unique()\ntrainImageIds = df.ImageId.unique()\n\ndef get_image_names(imageId):\n    d = {'3': '{}/three_band/{}.tif'.format(inDir, imageId),\n         'A': '{}/sixteen_band/{}_A.tif'.format(inDir, imageId),\n         'M': '{}/sixteen_band/{}_M.tif'.format(inDir, imageId),\n         'P': '{}/sixteen_band/{}_P.tif'.format(inDir, imageId),\n        }\n    return d\n\ndef get_images(imageId, img_key = None):\n    img_name\n"}],"metadata":{"_change_revision":0,"_is_fork":false,"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.5.2"}},"nbformat":4,"nbformat_minor":0}