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

@dpascualhe

Copy link
Copy Markdown
Collaborator

Hi @ashishsoni-ai , nice contribution! The only thing that needs fixing before merging is removing duplicated imports and moving those that are actually new to the first cell for consistency

… 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
@ashishsoni-ai ashishsoni-ai force-pushed the fix/tutorial-windows-coco-setup branch from 9b920e6 to b8e94ff Compare July 10, 2026 15:52
@ashishsoni-ai

Copy link
Copy Markdown
Author

Thanks for the review @dpascualhe . Cleaned up the duplicate imports and moved the new ones into the first cell. Let me know if anything else needs adjusting — happy to help with more issues if there are any you'd point me toward.

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

3 participants