{"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_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"I tried running a library  IPyPlot.\n* https://github.com/karolzak/ipyplot \n* https://reposhub.com/python/imagery/karolzak-ipyplot.html","metadata":{}},{"cell_type":"code","source":"!pip install ipyplot","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:51:14.796242Z","iopub.execute_input":"2021-09-15T07:51:14.796783Z","iopub.status.idle":"2021-09-15T07:51:24.634996Z","shell.execute_reply.started":"2021-09-15T07:51:14.796679Z","shell.execute_reply":"2021-09-15T07:51:24.633787Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import ipyplot\nimport pandas as pd\nimport numpy as np\nfrom PIL import Image, ImageFilter","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:51:58.840390Z","iopub.execute_input":"2021-09-15T07:51:58.841129Z","iopub.status.idle":"2021-09-15T07:51:58.856580Z","shell.execute_reply.started":"2021-09-15T07:51:58.841080Z","shell.execute_reply":"2021-09-15T07:51:58.855779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ls ../input/","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:51:59.832697Z","iopub.execute_input":"2021-09-15T07:51:59.833011Z","iopub.status.idle":"2021-09-15T07:52:00.625974Z","shell.execute_reply.started":"2021-09-15T07:51:59.832977Z","shell.execute_reply":"2021-09-15T07:52:00.624890Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('../input/cassava-leaf-disease-classification/train.csv')\ntrain.head()","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-09-15T07:52:00.628031Z","iopub.execute_input":"2021-09-15T07:52:00.628838Z","iopub.status.idle":"2021-09-15T07:52:00.687017Z","shell.execute_reply.started":"2021-09-15T07:52:00.628785Z","shell.execute_reply":"2021-09-15T07:52:00.685992Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ls ../input/cassava-leaf-disease-classification/","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:52:19.834296Z","iopub.execute_input":"2021-09-15T07:52:19.834564Z","iopub.status.idle":"2021-09-15T07:52:20.619460Z","shell.execute_reply.started":"2021-09-15T07:52:19.834539Z","shell.execute_reply":"2021-09-15T07:52:20.618590Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\n\ntrain_image_dir = '../input/cassava-leaf-disease-classification/train_images/'\nSAMPLE_NUM = 20\nimages_path = []\nimages_pil = []\nimages_ndarray = []\n\n\nfor i in range(SAMPLE_NUM):\n    images_path.append(train_image_dir + train['image_id'].values[i])\n    image_pil = Image.open(images_path[i])\n    images_pil.append(image_pil)\n    images_ndarray.append(np.array(image_pil))","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:52:20.621297Z","iopub.execute_input":"2021-09-15T07:52:20.621985Z","iopub.status.idle":"2021-09-15T07:52:21.134223Z","shell.execute_reply.started":"2021-09-15T07:52:20.621917Z","shell.execute_reply":"2021-09-15T07:52:21.133098Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# PLOT CRASS TABS ","metadata":{}},{"cell_type":"code","source":"ipyplot.plot_class_tabs(images_path, train['label'].values[:SAMPLE_NUM], force_b64=True)\n# The kaggle notepad and jupyter notebook environment, seem to require force_b64 to be specified.  ref:https://github.com/karolzak/ipyplot/issues/22\n","metadata":{"execution":{"iopub.status.busy":"2021-09-15T08:02:29.748864Z","iopub.execute_input":"2021-09-15T08:02:29.749199Z","iopub.status.idle":"2021-09-15T08:02:30.159913Z","shell.execute_reply.started":"2021-09-15T08:02:29.749159Z","shell.execute_reply":"2021-09-15T08:02:30.158941Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipyplot.plot_class_tabs(images_pil, train['label'].values[:SAMPLE_NUM])","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:59:00.868858Z","iopub.execute_input":"2021-09-15T07:59:00.869182Z","iopub.status.idle":"2021-09-15T07:59:01.061723Z","shell.execute_reply.started":"2021-09-15T07:59:00.869143Z","shell.execute_reply":"2021-09-15T07:59:01.060405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ipyplot.plot_class_tabs(images_ndarray, train['label'].values[:SAMPLE_NUM])","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:59:01.899702Z","iopub.execute_input":"2021-09-15T07:59:01.900025Z","iopub.status.idle":"2021-09-15T07:59:02.137337Z","shell.execute_reply.started":"2021-09-15T07:59:01.899990Z","shell.execute_reply":"2021-09-15T07:59:02.136345Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# plot images","metadata":{}},{"cell_type":"code","source":"ipyplot.plot_images(images_pil, train['label'].values[:SAMPLE_NUM])","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:59:08.813474Z","iopub.execute_input":"2021-09-15T07:59:08.813788Z","iopub.status.idle":"2021-09-15T07:59:09.011334Z","shell.execute_reply.started":"2021-09-15T07:59:08.813755Z","shell.execute_reply":"2021-09-15T07:59:09.010489Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# plot_class_representations","metadata":{}},{"cell_type":"code","source":"ipyplot.plot_class_representations(images_pil, train['label'].values[:SAMPLE_NUM])","metadata":{"execution":{"iopub.status.busy":"2021-09-15T07:59:09.962664Z","iopub.execute_input":"2021-09-15T07:59:09.962943Z","iopub.status.idle":"2021-09-15T07:59:10.020108Z","shell.execute_reply.started":"2021-09-15T07:59:09.962915Z","shell.execute_reply":"2021-09-15T07:59:10.019255Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}