Update app.py
Browse files
app.py
CHANGED
@@ -12,31 +12,31 @@ from huggingface_hub import hf_hub_download
|
|
12 |
# 1. Define Hugging Face dataset + weights
|
13 |
# =========================================
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
|
41 |
# =========================================
|
42 |
# 2. Import the FloVD generation pipeline
|
|
|
12 |
# 1. Define Hugging Face dataset + weights
|
13 |
# =========================================
|
14 |
|
15 |
+
HF_DATASET_REPO = "roll-ai/FloVD-weights" # your dataset repo on HF
|
16 |
+
|
17 |
+
WEIGHT_FILES = {
|
18 |
+
"ckpt/FVSM/FloVD_FVSM_Controlnet.pt": "FVSM/FloVD_FVSM_Controlnet.pt",
|
19 |
+
"ckpt/OMSM/selected_blocks.safetensors": "OMSM/selected_blocks.safetensors",
|
20 |
+
"ckpt/OMSM/pytorch_lora_weights.safetensors": "OMSM/pytorch_lora_weights.safetensors",
|
21 |
+
"ckpt/others/depth_anything_v2_metric_hypersim_vitb.pth": "others/depth_anything_v2_metric_hypersim_vitb.pth"
|
22 |
+
}
|
23 |
+
|
24 |
+
def download_weights():
|
25 |
+
print("π Downloading model weights via huggingface_hub...")
|
26 |
+
for hf_path, local_rel_path in WEIGHT_FILES.items():
|
27 |
+
local_path = Path("ckpt") / local_rel_path
|
28 |
+
if not local_path.exists():
|
29 |
+
print(f"π₯ Downloading {hf_path}")
|
30 |
+
hf_hub_download(
|
31 |
+
repo_id=HF_DATASET_REPO,
|
32 |
+
repo_type="dataset",
|
33 |
+
filename=hf_path,
|
34 |
+
local_dir="./"
|
35 |
+
)
|
36 |
+
else:
|
37 |
+
print(f"β
Already exists: {local_path}")
|
38 |
+
|
39 |
+
download_weights()
|
40 |
|
41 |
# =========================================
|
42 |
# 2. Import the FloVD generation pipeline
|