{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"!mkdir data","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cd data","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"ls","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"!mkdir 0\n!mkdir 1\n!mkdir 2\n!mkdir 3\n!mkdir 4","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"ls","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import tensorflow as tf\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom PIL import Image\n\n%matplotlib inline\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"TRAIN_IMG_DIR = '../../input/cassava-leaf-disease-classification/train_images/'\nTRAIN_LABEL_PATH = '../../input/cassava-leaf-disease-classification/train.csv'\nTRAIN_IMG_NP_ARRAY_DIR = 'images.npy'\ncsv = pd.read_csv(TRAIN_LABEL_PATH)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"IMAGE_SIZE = (528, 528)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# Import images\ni = 0\n\nfor file, idx in csv.values:\n    img = Image.open(TRAIN_IMG_DIR + file)\n    img = img.resize(IMAGE_SIZE, Image.LANCZOS)\n    \n    img.save(f'{idx}/{file}')\n    \n    i = i + 1\n    if i%1000 == 0: print(i)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cd ..","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import tensorflow as tf\nbase =  tf.keras.applications.EfficientNetB6(\n        include_top=True,\n        weights=None,\n        input_shape=None)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"base.input","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"!ls","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}