{"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\nprint(os.listdir(\"../input\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":11,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"X_test = []\nX_train = []\nY_test = []\nY_train = []\nstrt = 0\nos.listdir(\"../input/train\")","execution_count":24,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"dfb7040e295098364c43d61ad525c277010d5c0b"},"cell_type":"code","source":"from PIL import Image\nimport re\nimport cv2","execution_count":25,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"4e6065ab617925fa0bdda4fc095bd01fb9c703c6","collapsed":true},"cell_type":"code","source":"def load_train(X_train, Y_train, current_class):\n    d_class = 'c'+str(current_class)\n    count = 0\n    for_y = [0]*10\n    for_y[current_class] = 1\n    for images in os.listdir(\"../input/train/\"+d_class):\n        img = cv2.imread(\"../input/train/\"+d_class+\"/\"+images)\n        X_train.append(img)\n        Y_train.append(for_y)\n        count += 1\n    print(str(count)+\" images processed for class \" + d_class)\n    return X_train, Y_train, (current_class+1)%10\n\n        ","execution_count":26,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"e18fb65ec4badf9f603c46e550e0ba72253bf6a6"},"cell_type":"code","source":"X_train, Y_train, strt = load_train(X_train, Y_train, strt)","execution_count":33,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"496084c8d818d6f859eb69ceb640452ea71354c4"},"cell_type":"code","source":"len(X_train)","execution_count":34,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"4c604944d5fbac356806196b4f2b64959a203251"},"cell_type":"code","source":"","execution_count":21,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"967d18b5da23e8b070806d1070210adf4c2683f2"},"cell_type":"code","source":"","execution_count":22,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"dd39f7f0cbafedcfee42734f69ab446a21e343ff"},"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.5","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}