From a337ee591ade3a3e676fba5d51f7adc29b4a7da5 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Tue, 9 Jan 2024 05:15:28 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20supervison=20downloader=20a?= =?UTF-8?q?dded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- examples/speed_estimation/README.md | 2 +- examples/speed_estimation/requirements.txt | 4 ++-- examples/speed_estimation/setup.sh | 14 -------------- examples/speed_estimation/video_downloader.py | 8 ++++++++ 4 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 examples/speed_estimation/setup.sh create mode 100644 examples/speed_estimation/video_downloader.py diff --git a/examples/speed_estimation/README.md b/examples/speed_estimation/README.md index 780368e8..35685938 100644 --- a/examples/speed_estimation/README.md +++ b/examples/speed_estimation/README.md @@ -36,7 +36,7 @@ https://github.com/roboflow/supervision/assets/26109316/0542fd3c-bb5f-475e-b96c- - download `vehicles.mp4` file ```bash - ./setup.sh + python3.10 video_downloader.py ``` ## 🛠️ script arguments diff --git a/examples/speed_estimation/requirements.txt b/examples/speed_estimation/requirements.txt index 3d57d9d6..63f20432 100644 --- a/examples/speed_estimation/requirements.txt +++ b/examples/speed_estimation/requirements.txt @@ -1,6 +1,6 @@ -gdown supervision==0.18.0rc1 - +tqdm +requests ultralytics super-gradients inference diff --git a/examples/speed_estimation/setup.sh b/examples/speed_estimation/setup.sh deleted file mode 100644 index 6e9e82bb..00000000 --- a/examples/speed_estimation/setup.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Get the directory where the script is located -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Check if 'data' directory does not exist and then create it -if [[ ! -e $DIR/data ]]; then - mkdir "$DIR/data" -else - echo "'data' directory already exists." -fi - -# Download the vehicles.mp4 file from Google Drive -gdown -O "$DIR/data/vehicles.mp4" "https://drive.google.com/uc?id=1pz68D1Gsx80MoPg-_q-IbEdESEmyVLm-" diff --git a/examples/speed_estimation/video_downloader.py b/examples/speed_estimation/video_downloader.py new file mode 100644 index 00000000..4272120b --- /dev/null +++ b/examples/speed_estimation/video_downloader.py @@ -0,0 +1,8 @@ +import os + +from supervision.assets import VideoAssets, download_assets + +if not os.path.exists("data"): + os.makedirs("data") +os.chdir("data") +download_assets(VideoAssets.VEHICLES)