{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Download FathomNet-FGVC 2023 images\n", "## March 24, 2023\n", "\n", "This notebook downloads images for the [FathomNet 2023 Competition](https://www.kaggle.com/competitions/fathomnet-out-of-sample-detection/overview). It assumes that the dataset has been downloaded from Kaggle and retains the original directory structure:\n", "\n", "```\n", "../fathomnet-out-of-sample-detection\n", " |\n", " |____multilabel_classification\n", " | |____train.csv\n", " |____object_detection\n", " | |____eval.json\n", " | |____train.json\n", " |____category_key.csv\n", " |____demo_download.ipynb\n", " |____download_images.py\n", " |____requirements.txt\n", " |____sample_submission.csv\n", "```" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Install requirements\n", "This installs the requirements in the current python3 environment." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%pip install -r requirements.txt" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Start download\n", "\n", "First download the training data. The script `download_images.py` will by default create a new directory called `images` where all the downloaded files will live. If you want the images to live someplace else on your local machine, specify an output directory using the `--outpath` flag. This may take upwards of an hour depending on your internet connection. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!python download_images.py object_detection/train.json " ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Now download the evaluation data. Again, if you want to save the images to a different directory, please specify the location with the `--outpath` flag. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!python download_images.py object_detection/eval.json" ] } ], "metadata": { "kernelspec": { "display_name": "fgvc-comp-2023", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.9" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }