From 392e402c2eece87ab3d4dad220366ccbdb4f99c3 Mon Sep 17 00:00:00 2001 From: Craig Date: Sat, 12 Apr 2025 10:14:46 +0100 Subject: [PATCH] chore: Update .gitignore to include custom ignores and remove outdated hint from prompt_plan.md --- .gitignore | 8 +++++++- prompt_plan.md | 1 - scripts/download_data.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100755 scripts/download_data.sh diff --git a/.gitignore b/.gitignore index 1800114..bf6241f 100644 --- a/.gitignore +++ b/.gitignore @@ -171,4 +171,10 @@ cython_debug/ .ruff_cache/ # PyPI configuration file -.pypirc \ No newline at end of file +.pypirc + +# Custom Ignores +data/ +outputs/ +logs/ +*.pth \ No newline at end of file diff --git a/prompt_plan.md b/prompt_plan.md index d9ef64e..85e0994 100644 --- a/prompt_plan.md +++ b/prompt_plan.md @@ -101,7 +101,6 @@ Implement the core dataset loading logic in `utils/data_utils.py`: * In `__len__(self)`: * Return the total number of images. -*(Hint: Refer to the Torchvision Object Detection Finetuning Tutorial for guidance on parsing masks and structuring the target dictionary: https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html)* ``` ## Prompt 5: Data Utilities (Transforms and Collate) diff --git a/scripts/download_data.sh b/scripts/download_data.sh new file mode 100755 index 0000000..e3da710 --- /dev/null +++ b/scripts/download_data.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e # Exit immediately if a command exits with a non-zero status. + +DATA_DIR="data" +TARGET_DIR="$DATA_DIR/PennFudanPed" +ZIP_FILE="$DATA_DIR/PennFudanPed.zip" +URL="https://www.cis.upenn.edu/~jshi/ped_html/PennFudanPed.zip" + +# 1. Check if the target directory already exists +if [ -d "$TARGET_DIR" ]; then + echo "Dataset already exists at $TARGET_DIR. Skipping download." + exit 0 +fi + +# 2. Create the data directory if it doesn't exist +mkdir -p "$DATA_DIR" +echo "Created directory $DATA_DIR (if it didn't exist)." + +# 3. Download the dataset +echo "Downloading dataset from $URL..." +wget -O "$ZIP_FILE" "$URL" +echo "Download complete." + +# 4. Extract the dataset +echo "Extracting $ZIP_FILE to $DATA_DIR..." +unzip -q "$ZIP_FILE" -d "$DATA_DIR" # -q for quiet mode +echo "Extraction complete." + +# 5. Remove the zip file +rm "$ZIP_FILE" +echo "Removed $ZIP_FILE." + +echo "Dataset setup complete in $TARGET_DIR." \ No newline at end of file