-
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.
Enable automatic loading of the results folder and update the README …
…accordingly.
- Loading branch information
Hhyemin
committed
Feb 12, 2025
1 parent
affab4e
commit 48d8646
Showing
2 changed files
with
35 additions
and
5 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
21 changes: 21 additions & 0 deletions
21
src/suppression_study/experiments/LoadPreComputedResults.py
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,21 @@ | ||
import os | ||
import requests | ||
import zipfile | ||
from io import BytesIO | ||
|
||
|
||
GITHUB_RELEASE_URL = "https://github.com/sola-st/suppression_study/releases/download/v1.0.0/results.zip" | ||
DESTINATION_FOLDER = "./data" # save the results folder inside the "data" folder (data/results). | ||
os.makedirs(DESTINATION_FOLDER, exist_ok=True) | ||
|
||
print("Downloading pre-computed results...") | ||
response = requests.get(GITHUB_RELEASE_URL, stream=True) | ||
|
||
if response.status_code == 200: | ||
print("Download complete. Extracting files...") | ||
with zipfile.ZipFile(BytesIO(response.content), 'r') as zip_ref: | ||
zip_ref.extractall(DESTINATION_FOLDER) | ||
|
||
print(f"Files extracted to: {DESTINATION_FOLDER}") | ||
else: | ||
print(f"Failed to download file. HTTP Status Code: {response.status_code}") |