{"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\nfrom tqdm.notebook import tqdm\ntqdm.pandas()\nimport pandas as pd\nimport os\nimport cv2\nimport matplotlib.pyplot as plt\nimport glob\n\nimport shutil\nimport sys\nsys.path.append('../input/tensorflow-great-barrier-reef')\n\nfrom joblib import Parallel, delayed\n\nfrom IPython.display import display","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-01-26T07:23:22.324345Z","iopub.execute_input":"2022-01-26T07:23:22.32467Z","iopub.status.idle":"2022-01-26T07:23:22.687979Z","shell.execute_reply.started":"2022-01-26T07:23:22.324584Z","shell.execute_reply":"2022-01-26T07:23:22.687081Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"https://www.kaggle.com/c/tensorflow-great-barrier-reef","metadata":{}},{"cell_type":"markdown","source":"../input/tensorflow-great-barrier-reef","metadata":{}},{"cell_type":"code","source":"ROOT_DIR  = '../input/tensorflow-great-barrier-reef'\nIMAGE_DIR = '/kaggle/images' # directory to save images\nLABEL_DIR = '/kaggle/labels' # directory to save labels\n","metadata":{"execution":{"iopub.status.busy":"2022-01-26T07:23:22.689469Z","iopub.execute_input":"2022-01-26T07:23:22.689768Z","iopub.status.idle":"2022-01-26T07:23:22.694618Z","shell.execute_reply.started":"2022-01-26T07:23:22.689729Z","shell.execute_reply":"2022-01-26T07:23:22.693516Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!mkdir -p {IMAGE_DIR}\n!mkdir -p {LABEL_DIR}","metadata":{"execution":{"iopub.status.busy":"2022-01-26T07:23:22.6959Z","iopub.execute_input":"2022-01-26T07:23:22.696258Z","iopub.status.idle":"2022-01-26T07:23:24.247583Z","shell.execute_reply.started":"2022-01-26T07:23:22.696216Z","shell.execute_reply":"2022-01-26T07:23:24.246624Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Train Data\ndf = pd.read_csv(f'{ROOT_DIR}/train.csv')\ndf['old_image_path'] = f'{ROOT_DIR}/train_images/video_'+df.video_id.astype(str)+'/'+df.video_frame.astype(str)+'.jpg'\ndf['image_path']  = f'{IMAGE_DIR}/'+df.image_id+'.jpg'\ndf['label_path']  = f'{LABEL_DIR}/'+df.image_id+'.txt'\ndf['annotations'] = df['annotations'].progress_apply(eval)\ndisplay(df.head(2))\n","metadata":{"execution":{"iopub.status.busy":"2022-01-26T07:23:24.250131Z","iopub.execute_input":"2022-01-26T07:23:24.250714Z","iopub.status.idle":"2022-01-26T07:23:24.891362Z","shell.execute_reply.started":"2022-01-26T07:23:24.250663Z","shell.execute_reply":"2022-01-26T07:23:24.890451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Image Analysis","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}