{"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.0"}},"nbformat":4,"nbformat_minor":0,"cells":[{"cell_type":"markdown","metadata":{"_cell_guid":"e3454c7e-383a-1078-0c62-0c879e5020ba","_active":false,"collapsed":false},"source":"## Packages Loading  ##","execution_count":null,"outputs":[],"execution_state":"idle"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"8810cd73-bff4-d43c-31ad-ec9906079f17","_active":false,"collapsed":false},"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)\nimport cv2\nfrom matplotlib import pyplot as plt\nimport os\nimport sys\nimport glob\n%matplotlib inline\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/train/\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output.","execution_state":"idle"},{"metadata":{"_cell_guid":"6d5e129c-c4a0-f8e3-a215-e35b628bbf18","_active":false,"collapsed":false},"source":"**\n\nTraining Data Parsing and Feature Preparation\n-----------------------------------------\n\n**","execution_count":null,"cell_type":"markdown","outputs":[]},{"metadata":{"_cell_guid":"9ca014eb-5622-300e-be7c-bc8c2e105839","_active":false,"collapsed":false},"source":"for filename in glob.iglob('../input/train/*/*.jpg', recursive=True):\n    print(filename)\n    img = cv2.imread(filename)\n    #print(img.shape)\n    gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n    # Resize the Grey image to 250*250 Pixels\n    resized_image = cv2.resize(gray_image, (250, 250)) \n    \n\n#for root, subdirs, files in os.walk(walk_dir):\n#    with open(list_file_path, 'wb') as list_file:\n#        for filename in files:\n#            if (filename.find('.jpg') != -1): \n#                file_path = os.path.join(root, filename)\n                # All the RGB components of the image\n                #img = cv2.imread(file_path)\n                # Only one component of the image\n#                img = cv2.imread(file_path,0)\n                \n                #resized_image = cv2.resize(img, (100, 50)) \n#                print(file_path)\n#                print(img.shape)\n                #plt.imshow(img, cmap = 'gray', interpolation = 'bicubic')\n                #plt.xticks([]), plt.yticks([])  # to hide tick values on X and Y axis\n                #plt.show()","execution_count":5,"cell_type":"code","outputs":[],"execution_state":"idle"}]}