mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-28 03:29:51 +00:00
Update initializer.py
This commit is contained in:
parent
b3844aea62
commit
e286e2f39b
1 changed files with 3 additions and 19 deletions
|
|
@ -1,24 +1,8 @@
|
|||
# wfgy_sdk/initializer.py
|
||||
|
||||
import os, zipfile, requests
|
||||
import os
|
||||
from .utils import DATA_DIR
|
||||
|
||||
URLS = {
|
||||
"data": "https://zenodo.org/.../wfgy_data.zip",
|
||||
"weights": "https://zenodo.org/.../wfgy_weights.zip",
|
||||
"configs": "https://zenodo.org/.../wfgy_configs.zip"
|
||||
}
|
||||
|
||||
def initialize():
|
||||
os.makedirs(DATA_DIR, exist_ok=True)
|
||||
for name, url in URLS.items():
|
||||
target = os.path.join(DATA_DIR, f"{name}.zip")
|
||||
print(f"Downloading {name}...")
|
||||
resp = requests.get(url, stream=True)
|
||||
with open(target, "wb") as f:
|
||||
for c in resp.iter_content(1024):
|
||||
f.write(c)
|
||||
with zipfile.ZipFile(target, "r") as z:
|
||||
z.extractall(DATA_DIR)
|
||||
os.remove(target)
|
||||
print("Initialization complete.")
|
||||
print("No download required.")
|
||||
print(f"All demo data is already included in the repository at: {DATA_DIR}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue