Skip to content

feat: add show_progress to dataset load/save operations#2275

Open
murillo-ro-silva wants to merge 2 commits into
roboflow:developfrom
murillo-ro-silva:feat/dataset-progress-bars
Open

feat: add show_progress to dataset load/save operations#2275
murillo-ro-silva wants to merge 2 commits into
roboflow:developfrom
murillo-ro-silva:feat/dataset-progress-bars

Conversation

@murillo-ro-silva
Copy link
Copy Markdown

@murillo-ro-silva murillo-ro-silva commented May 25, 2026

Summary

Closes #183.

Note: PR #2181 by @satishkc7 addresses the same issue but currently has merge conflicts and has been inactive since March. This is a fresh implementation with the same approach — happy to close this if #2181 is preferred or to help resolve its conflicts instead.

Adds an optional show_progress: bool = False parameter to all DetectionDataset loading and saving methods. When enabled, a tqdm progress bar is displayed during time-consuming operations.

Requirements from maintainers (comment)

  • Progress bar works in terminal and notebook (tqdm.auto)
  • Progress bar is optional (show_progress=False by default)

Supported methods

Method Description
DetectionDataset.from_coco() Loading COCO annotations
DetectionDataset.from_yolo() Loading YOLO annotations
DetectionDataset.from_pascal_voc() Loading Pascal VOC annotations
DetectionDataset.as_coco() Saving to COCO format
DetectionDataset.as_yolo() Saving to YOLO format
DetectionDataset.as_pascal_voc() Saving to Pascal VOC format
save_dataset_images() Saving images to directory

Usage

import supervision as sv

# Loading with progress bar
ds = sv.DetectionDataset.from_yolo(
    images_directory_path="train/images",
    annotations_directory_path="train/labels",
    data_yaml_path="data.yaml",
    show_progress=True,
)

# Saving with progress bar
ds.as_coco(
    images_directory_path="output/images",
    annotations_path="output/annotations.json",
    show_progress=True,
)

Design decisions

  • Defaults to False — fully backward compatible, no behavior change for existing code
  • Uses tqdm.auto — works in both terminal and Jupyter notebooks (same pattern as supervision.utils.video)
  • tqdm is already a dependency — no new dependencies added

Test plan

  • 13 new tests in tests/dataset/test_progress.py
  • All 157 existing dataset tests pass with no regressions
  • pre-commit run --all-files passes (ruff, mypy, codespell, etc.)
  • Verified show_progress=False (default) keeps tqdm disabled
  • Verified show_progress=True enables tqdm for each format
  • Backward compatibility: existing calls without show_progress work unchanged

Murillo Rodrigues added 2 commits May 25, 2026 17:50
Add `show_progress` parameter to all dataset loading and saving methods.
When enabled, displays a tqdm progress bar during time-consuming
operations like loading/saving COCO, YOLO, and Pascal VOC datasets.

- Defaults to `False` for full backward compatibility
- Uses `tqdm.auto` for terminal and Jupyter notebook support
- Includes 13 new tests covering all formats and backward compatibility
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Murillo Rodrigues seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@satishkc7
Copy link
Copy Markdown
Contributor

Just a heads up - PR #2181 (my earlier implementation) has been rebased onto current develop and is now conflict-free. Happy to close #2181 if you prefer this fresh implementation, or defer to maintainer preference on which to merge.

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.

Show Progress in time consuming tasks

3 participants