{"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":"code","source":"import numpy as np\nimport pandas as pd\nfrom pathlib import Path\nimport json","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-02-15T00:07:36.624469Z","iopub.execute_input":"2022-02-15T00:07:36.625391Z","iopub.status.idle":"2022-02-15T00:07:36.631794Z","shell.execute_reply.started":"2022-02-15T00:07:36.625343Z","shell.execute_reply":"2022-02-15T00:07:36.631018Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Train","metadata":{}},{"cell_type":"markdown","source":"Let's have a first look:","metadata":{}},{"cell_type":"code","source":"INPUT = Path('/kaggle/input/herbarium-2022-fgvc9/')","metadata":{"execution":{"iopub.status.busy":"2022-02-14T23:53:28.426693Z","iopub.execute_input":"2022-02-14T23:53:28.427281Z","iopub.status.idle":"2022-02-14T23:53:28.430638Z","shell.execute_reply.started":"2022-02-14T23:53:28.427246Z","shell.execute_reply":"2022-02-14T23:53:28.429989Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"with open(INPUT/'train_metadata.json', 'r') as f:\n    data = json.load(f)","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:09:47.745039Z","iopub.execute_input":"2022-02-15T00:09:47.745445Z","iopub.status.idle":"2022-02-15T00:09:56.375472Z","shell.execute_reply.started":"2022-02-15T00:09:47.74541Z","shell.execute_reply":"2022-02-15T00:09:56.374562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_annotations = pd.json_normalize(data['annotations'])\ndf_images = pd.json_normalize(data['images'])\ndf_categories = pd.json_normalize(data['categories'])\ndf_genera = pd.json_normalize(data['genera'])\ndf_institutions = pd.json_normalize(data['institutions'])\ndf_distances = pd.json_normalize(data['distances'])\ndf_license = pd.json_normalize(data['license'])","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:16:38.842641Z","iopub.execute_input":"2022-02-15T00:16:38.843418Z","iopub.status.idle":"2022-02-15T00:16:57.417077Z","shell.execute_reply.started":"2022-02-15T00:16:38.843377Z","shell.execute_reply":"2022-02-15T00:16:57.416376Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_annotations.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:23:22.839867Z","iopub.execute_input":"2022-02-15T00:23:22.840646Z","iopub.status.idle":"2022-02-15T00:23:22.853344Z","shell.execute_reply.started":"2022-02-15T00:23:22.840593Z","shell.execute_reply":"2022-02-15T00:23:22.852665Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_images.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:24:53.813683Z","iopub.execute_input":"2022-02-15T00:24:53.813975Z","iopub.status.idle":"2022-02-15T00:24:53.823802Z","shell.execute_reply.started":"2022-02-15T00:24:53.813947Z","shell.execute_reply":"2022-02-15T00:24:53.823135Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_categories.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:25:01.010828Z","iopub.execute_input":"2022-02-15T00:25:01.011255Z","iopub.status.idle":"2022-02-15T00:25:01.02215Z","shell.execute_reply.started":"2022-02-15T00:25:01.011224Z","shell.execute_reply":"2022-02-15T00:25:01.021054Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_genera.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:25:08.829458Z","iopub.execute_input":"2022-02-15T00:25:08.82977Z","iopub.status.idle":"2022-02-15T00:25:08.839108Z","shell.execute_reply.started":"2022-02-15T00:25:08.829731Z","shell.execute_reply":"2022-02-15T00:25:08.838256Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_institutions.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:25:15.242446Z","iopub.execute_input":"2022-02-15T00:25:15.242805Z","iopub.status.idle":"2022-02-15T00:25:15.251195Z","shell.execute_reply.started":"2022-02-15T00:25:15.242766Z","shell.execute_reply":"2022-02-15T00:25:15.250623Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_distances.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:25:23.427392Z","iopub.execute_input":"2022-02-15T00:25:23.42819Z","iopub.status.idle":"2022-02-15T00:25:23.437323Z","shell.execute_reply.started":"2022-02-15T00:25:23.428147Z","shell.execute_reply":"2022-02-15T00:25:23.436575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_license.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-15T00:25:34.167472Z","iopub.execute_input":"2022-02-15T00:25:34.168535Z","iopub.status.idle":"2022-02-15T00:25:34.179458Z","shell.execute_reply.started":"2022-02-15T00:25:34.168484Z","shell.execute_reply":"2022-02-15T00:25:34.178697Z"},"trusted":true},"execution_count":null,"outputs":[]}]}