Rename asset_list.py and update VideoAssets enumeration

The file asset_list.py has been renamed to list.py for better readability and simplicity. In the VideoAssets enumeration, additional information has been included. This includes specific details for each member of the enum, notably the filename of the related video and its URL.
This commit is contained in:
SkalskiP 2023-10-24 15:01:03 +02:00
parent 3391eec078
commit 3f5f5fb070
5 changed files with 24 additions and 2 deletions

7
docs/assets.md Normal file
View File

@ -0,0 +1,7 @@
## download_assets
:::supervision.assets.downloader.download_assets
## VideoAssets
:::supervision.assets.list.VideoAssets

View File

@ -53,6 +53,7 @@ nav:
- Image: utils/image.md
- Notebook: utils/notebook.md
- File: utils/file.md
- Assets: assets.md
- Changelog: changelog.md
theme:

View File

@ -1,2 +1,2 @@
from .asset_list import VideoAssets
from .list import VideoAssets
from .downloader import download_assets

View File

@ -5,7 +5,7 @@ from shutil import copyfileobj
from typing import Union
from supervision.assets import VideoAssets
from supervision.assets.asset_list import VIDEO_ASSETS
from supervision.assets.list import VIDEO_ASSETS
try:
from requests import Response, get

View File

@ -5,6 +5,20 @@ BASE_VIDEO_URL = "https://media.roboflow.com/supervision/video-examples/"
class VideoAssets(Enum):
""" #noqa
Each member of this enum represents a video asset. The value associated with each
member is the filename of the video.
| Enum Member | Video Filename | Video URL |
|------------------------|----------------------------|---------------------------------------------------------------------------------------|
| `VEHICLES` | `vehicles.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/vehicles.mp4) |
| `MILK_BOTTLING_PLANT` | `milk-bottling-plant.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/milk-bottling-plant.mp4) |
| `VEHICLES_2` | `vehicles-2.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/vehicles-2.mp4) |
| `GROCERY_STORE` | `grocery-store.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/grocery-store.mp4) |
| `SUBWAY` | `subway.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/subway.mp4) |
| `MARKET_SQUARE` | `market-square.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/market-square.mp4) |
| `PEOPLE_WALKING` | `people-walking.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/people-walking.mp4) |
"""
VEHICLES = "vehicles.mp4"
MILK_BOTTLING_PLANT = "milk-bottling-plant.mp4"
VEHICLES_2 = "vehicles-2.mp4"