Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ImageAssets for download #932

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

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
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.

None yet

2 participants