Skip to content

Fix Windows-incompatible mkdir and add COCO auto-download to tutorial notebook#613

Open
ashishsoni-ai wants to merge 1 commit into
JdeRobot:masterfrom
ashishsoni-ai:fix/tutorial-windows-coco-setup
Open

Fix Windows-incompatible mkdir and add COCO auto-download to tutorial notebook#613
ashishsoni-ai wants to merge 1 commit into
JdeRobot:masterfrom
ashishsoni-ai:fix/tutorial-windows-coco-setup

Conversation

@ashishsoni-ai

Copy link
Copy Markdown

What

Fixes tutorial_image_detection.ipynb so it runs end-to-end on Windows without manual intervention.

Why

  • !mkdir -p fails on Windows (cmd.exe doesn't support the -p flag), throwing a SyntaxError
  • The COCO dataset cell had placeholder paths (<PATH_TO_COCO_VAL2017_IMAGES>) with no download guidance, blocking new contributors from running the notebook at all

Changes

  • Replaced the Unix-only !mkdir -p calls with cross-platform os.makedirs(..., exist_ok=True)
  • Added a cell that automatically downloads and extracts COCO annotations, with an option to either:
    • use a small subset (default, ~20 images, fast) for quick testing, or
    • download the full val2017 dataset for complete evaluation
  • Updated the dataset-loading cell to use the downloaded paths instead of placeholders

Testing

Ran the full notebook end-to-end on Windows 11 (Python 3.11, PyTorch 2.4.1 CPU) — all cells execute successfully, including model inference, evaluation metrics, and the precision-recall curve output.

Fixes #612

… notebook

- Replace Unix-only '!mkdir -p' with cross-platform os.makedirs()
- Add automated COCO val2017 download/extraction with small-subset
  option so the notebook runs end-to-end without manual dataset setup
  or large downloads

Fixes JdeRobot#612
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tutorial_image_detection.ipynb fails on Windows: Unix-only shell command and missing COCO dataset setup instructions

2 participants