Conversation
|
@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 I believe there should be a similar directory created how the video assets are under |
779dc77 to
554e091
Compare
5cbda94 to
554e091
Compare
|
@copilot review this PR using the full structured format defined in .github/copilot-instructions.md |
There was a problem hiding this comment.
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
ImageAssetsand aBASE_IMAGE_URL, and consolidates image/video metadata intoMEDIA_ASSETS. - Updates
download_assets()to acceptImageAssetsin addition toVideoAssetsand 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. |
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.
Description
This PR is related to Issue #926.
The idea is to add
ImageAssetsfor download along side the already greatVideoAssets.Type of change
This change is a non-breaking change.
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
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
Changes to the the
docs/assetsand changes to docstrings in the function were changed.