{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"# Import packages \nimport pandas as pd \nimport os \nimport numpy as np \nimport matplotlib.pyplot as plt \nimport json \nimport cv2\nimport seaborn as sn ","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# List files available\nlist_dir= \"../input/cassava-leaf-disease-classification\"\nprint(list_dir)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# extract all the files \n\n# train.csv\ntrain_csv = pd.read_csv(os.path.join(list_dir, \"train.csv\"))\ntrain_csv","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# extract label file \n# opening JSON file \nlabel_file = open(\"../input/cassava-leaf-disease-classification/label_num_to_disease_map.json\")\n\n# Returning JSON object as a dictionary\nlabel_data = json.load(label_file)\n#print(type(label_data))\n\n# Iterating the JSON dictionary \nfor key,value in label_data.items():\n    print(key,value)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## Loading the data \n\n#### As we see we define the four labels that we will use. :\n   - Cassava Bacterial Blight (CBB)\n   - ‘Cassava Brown Streak Diseasse (CBSD)\n   - Cassava Mosaic Disease (DGM)\n   -  Healthy \n   \n"},{"metadata":{"trusted":true},"cell_type":"code","source":"# Extract images file \n\nfrom PIL import Image\nimport glob\nimage_list = []\nfor filename in glob.glob('../input/cassava-leaf-disease-classification/train_images/*.jpg'): \n    im=Image.open(filename)\n    image_list.append(im)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"image_list\n","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"it's abvious that all the picture have the same ***size =800x600***, and mode of  ***image_mode=RGB***"},{"metadata":{"trusted":true},"cell_type":"code","source":"# Let us also visualize a random image \n\nplt.figure(figsize = (5,5))\nplt.imshow(image_list[1])\nplt.title(\"Random Image\");\n\n\n\n","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"- let's see which type has more pictures "},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(8, 6))\nsn.countplot(x = \"label\",data=train_csv);","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"raw","source":"##Further more, coming soon "},{"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}