Skip to content

Add ImageAssets for download#932

Merged
Borda merged 19 commits intoroboflow:developfrom
NickHerrig:feature/image-assets
Feb 12, 2026
Merged

Add ImageAssets for download#932
Borda merged 19 commits intoroboflow:developfrom
NickHerrig:feature/image-assets

Conversation

@NickHerrig
Copy link
Contributor

Description

This PR is related to Issue #926.

The idea is to add ImageAssets for download along side the already great VideoAssets.

Type of change

This change is a non-breaking change.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

To test the change you can install the assets submodule by running

pip install -e ".[assets]"

From there, test the new functionality with

from supervision.assets import download_assets, VideoAssets, ImageAssets

# Old method of downloading video assets still relevant.
download_assets(VideoAssets.VEHICLES)
"vehicles.mp4"

# New method of downloading image assts.
download_assets(ImageAssets.PEOPLE_WALKING)
"people-walking.jpg"

Any specific deployment considerations

I did my best to change the documentation, but please call out anything I missed and I will update.

To simplify the code, I also included a "Assets" class, and each enum has a 'filename' and a 'hash' tied to it reduce verbosity of building out the "VIDEO_ASSETS" dictionary. Let me know if this isn't a good direction, and I can refactor. The customer facing behavior is still the same.

Docs

  • Docs updated? What were the changes:

Changes to the the docs/assets and changes to docstrings in the function were changed.

@NickHerrig
Copy link
Contributor Author

@onuralpszr and @SkalskiP I changed the assets data structures a little bit, so let me know if you're not a fan of this direction.

Also this is still a draft as the photo placeholder included a single image for testing from inference
BASE_IMAGE_URL = "https://media.roboflow.com/inference/

I believe there should be a similar directory created how the video assets are under
https://media.roboflow.com/supervision/video-examples/ for image assets called https://media.roboflow.com/supervision/image-examples/

@onuralpszr onuralpszr marked this pull request as ready for review February 28, 2024 13:57
@onuralpszr onuralpszr self-requested a review February 28, 2024 13:57
@onuralpszr onuralpszr added the API:assets Supervision Assets label Feb 28, 2024
@Borda Borda requested a review from SkalskiP as a code owner January 7, 2026 17:13
Borda
Borda previously approved these changes Feb 3, 2026
@Borda
Copy link
Member

Borda commented Feb 6, 2026

@copilot review this PR using the full structured format defined in .github/copilot-instructions.md

@Borda Borda requested review from Copilot and removed request for onuralpszr February 6, 2026 09:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class support for downloading image assets (via a new ImageAssets enum) alongside the existing video assets download workflow in supervision.assets.

Changes:

  • Introduces ImageAssets and a BASE_IMAGE_URL, and consolidates image/video metadata into MEDIA_ASSETS.
  • Updates download_assets() to accept ImageAssets in addition to VideoAssets and raw filename strings.
  • Updates tests and docs to cover and document the new image assets functionality.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/supervision/assets/list.py Adds ImageAssets, introduces shared Assets base, and builds unified MEDIA_ASSETS mapping.
src/supervision/assets/downloader.py Extends downloader to accept image assets and use unified asset registry.
src/supervision/assets/__init__.py Exposes ImageAssets from the package surface.
docs/assets.md Documents image assets alongside video assets.
tests/assets/test_list.py Updates asset list/value tests for new enums and unified mapping.
tests/assets/test_downloader.py Adds downloader test coverage for downloading via ImageAssets.

Borda and others added 7 commits February 6, 2026 20:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ogic with enhanced file checks and re-download handling. Add new tests for invalid asset cases and update existing test assertions.
…ith additional attributes for filename and md5_hash.
@Borda Borda merged commit 0ed48f0 into roboflow:develop Feb 12, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API:assets Supervision Assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants