Repository navigation
examples: use public COCO128 dataset and YOLOv8n model in YOLO tutorial - #641
Open
ashishsoni-ai wants to merge 1 commit into
Open
ashishsoni-ai wants to merge 1 commit into
ashishsoni-ai wants to merge 1 commit into
Conversation
Replaces the private TACO dataset and TorchScript model files (TACObboxSkewedResized.yaml / best.torchscript) with automated downloads of public GPL-3.0 assets: - COCO128 dataset (128 images, 80 classes, ~7 MB) - YOLOv8n pretrained weights (~6 MB) exported to TorchScript with dynamic=True and closest_divisor=32 padding Also switches evaluation split from test to val (matching COCO128's layout) and clears stale TACO cell outputs. Fixes JdeRobot#634.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
YOLO tutorial: use public COCO128 dataset and YOLOv8n model
What
Fixes
examples/tutorial_image_detection_yolo.ipynbso it runs end-to-end without access toprivate assets, following the same pattern as #613 (COCO tutorial).
Why
The notebook hard-coded three local paths that only exist on the original authors' machines:
local/data/datasets/TACObboxSkewedResized.yamllocal/data/datasets/TACOskewedBBoxResizedlocal/data/models/best.torchscriptwith no download links or preparation steps, so new contributors could not run the tutorial at
all (reported in #634).
Changes
stdlib-only cell downloads andextracts two small public GPL-3.0 assets into
local/data/on first run, skipping when alreadypresent:
coco128.yaml) — ~7 MB,from
ultralytics/assetsv0.0.0ultralytics/assetsv8.3.0!mkdir -pcalls withos.makedirs(..., exist_ok=True)(mirrors Fix Windows-incompatible mkdir and add COCO auto-download to tutorial notebook #613)ultralyticsexport ofyolov8n.pttoyolov8n.torchscriptwithdynamic=True, with a clearImportErrorhint topip install ultralyticsif the package is missing. Pre-exported YOLO-NAS checkpoints were notusable because they emit tuple outputs that the repo's parser does not accept.
"resize": {"closest_divisor": 32}so images are padded to amultiple of the YOLO stride (the exported dynamic model rejects other sizes); keeps
model_format: "yolo".cells instead of re-declaring private paths; the inference and evaluation cells use the
valsplit because COCO128 has no separate
testsplit.belonged to the private TACO assets and would be misleading next to COCO128.
Testing
Validated the exact notebook flow with the repo's own code (
YOLODataset,TorchImageDetectionModel.predict,.eval) on the downloaded assets:128 samples / 80 classes, split{'val': 128}bowl 0.93,broccoli 0.76on a 640×480 image{'metrics_df', 'metrics_factory'}withmAP@[0.5:0.95] ≈ 0.300andAUC-PR ≈ 0.330ast.parse; no stale TACO references remainFixes #634