{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","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 the files in the input directory\n\nimport os\nfiles=os.listdir(\"../input\")\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"a7742dbc24e1e7bd6fef2a6ac95d93c88d260a63"},"cell_type":"code","source":"labelled = pd.read_csv(\"../input/trainLabels.csv\")\nlabelled.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"97872fb4f87dc7dea68b3a4cfc2075888fea7ccc","scrolled":true},"cell_type":"code","source":"from PIL import Image\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport cv2\n\n\ni=0\nwidth = 200\nheight = 200\n\nfor image in files:\n    if i == 5:    \n        break\n    if image == \"trainLabels.csv\":\n        continue\n    image = os.path.join(\"../input/\",image)\n    img=Image.open(image)\n    pix = np.array(img)\n\n    pix_resized = cv2.resize(pix, dsize=(200, 200), interpolation=cv2.INTER_CUBIC)\n    \n    plt.imshow(pix_resized)\n    plt.show()\n    print(pix_resized,pix_resized.shape)\n    i = i+1\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"72a8cd91eff3127430beab3d13e4966ee983a22d"},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}