-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from humphrem/1.0.0-updates
Updates for downloading sample videos for 1.0.0
- Loading branch information
Showing
6 changed files
with
71 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
python3 action.py ./video/aquatic-demo.mov -c 0.45 -m 3.0 -s -b 1.0 -d -e aquatic | ||
python3 action.py ./video/aquatic_demo_1.mov -c 0.45 -m 3.0 -s -b 1.0 -d -e aquatic |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import os | ||
import requests | ||
|
||
# Get the package version from the environment variable | ||
package_version = os.getenv("PIXI_PACKAGE_VERSION") | ||
|
||
# URLs of the ONNX model files | ||
model_urls = [ | ||
f"https://github.com/humphrem/action/releases/download/v{package_version}/md_v5a_1_3_640_640_static.onnx", | ||
f"https://github.com/humphrem/action/releases/download/v{package_version}/yolov4_1_3_608_608_static.onnx", | ||
] | ||
|
||
# URLs of the sample video files | ||
video_urls = [ | ||
f"https://github.com/humphrem/action/releases/download/v{package_version}/aquatic_demo_1.mov", | ||
f"https://github.com/humphrem/action/releases/download/v{package_version}/aquatic_demo_2.mov", | ||
f"https://github.com/humphrem/action/releases/download/v{package_version}/terrestrial_demo_1.mov", | ||
f"https://github.com/humphrem/action/releases/download/v{package_version}/terrestrial_demo_2.mov", | ||
] | ||
|
||
|
||
# Function to download files | ||
def download_files(urls, directory): | ||
# Download each file | ||
for url in urls: | ||
# Get the file name by splitting the URL and taking the last part | ||
file_name = url.split("/")[-1] | ||
|
||
# Check if the file already exists | ||
if not os.path.exists(os.path.join(directory, file_name)): | ||
print(f"Downloading {file_name} (this will take some time...)") | ||
|
||
# Send a HTTP request to the URL of the file | ||
response = requests.get(url) | ||
|
||
# Write the content of the response to a file in the directory | ||
with open(os.path.join(directory, file_name), "wb") as file: | ||
file.write(response.content) | ||
|
||
print(f"Downloaded {file_name} successfully.") | ||
else: | ||
print(f"{file_name} already exists, skipping download.") | ||
|
||
|
||
# Create the models directory if it does not exist | ||
if not os.path.exists("models"): | ||
os.makedirs("models") | ||
print("Created 'models' directory") | ||
|
||
# Download model files | ||
download_files(model_urls, "models") | ||
|
||
|
||
# Create the video directory if it does not exist | ||
if not os.path.exists("video"): | ||
os.makedirs("video") | ||
print("Created 'video' directory") | ||
|
||
# Download video files | ||
download_files(video_urls, "video") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
python3 action.py ./video/terrestrial-demo.mov -c 0.45 -m 3.0 -s -i -b 1.0 -d -e terrestrial | ||
python3 action.py ./video/terrestrial_demo_1.mov -c 0.45 -m 3.0 -s -i -b 1.0 -d -e terrestrial |