Spaces:
Runtime error
Runtime error
Update src/generate_utils/generate.py
Browse files
src/generate_utils/generate.py
CHANGED
|
@@ -26,8 +26,8 @@ class PressureGenerator:
|
|
| 26 |
}
|
| 27 |
|
| 28 |
def __init__(self,
|
| 29 |
-
ckpt_dir="
|
| 30 |
-
smpl_model_dir="
|
| 31 |
device="cpu"):
|
| 32 |
"""
|
| 33 |
初始化生成器:加载配置、权重和 SMPL 模型。
|
|
@@ -58,7 +58,13 @@ class PressureGenerator:
|
|
| 58 |
def _load_config(self):
|
| 59 |
config_path = os.path.join(self.ckpt_dir, 'config.yaml')
|
| 60 |
if not os.path.exists(config_path):
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
with open(config_path, 'r') as f:
|
| 63 |
return yaml.safe_load(f)
|
| 64 |
|
|
@@ -70,7 +76,7 @@ class PressureGenerator:
|
|
| 70 |
from huggingface_hub import snapshot_download
|
| 71 |
snapshot_download(
|
| 72 |
"yolozyk/PaGe",
|
| 73 |
-
local_dir="
|
| 74 |
local_dir_use_symlinks=False,
|
| 75 |
ignore_patterns=["*.safetensors", ".gitattributes"],
|
| 76 |
)
|
|
|
|
| 26 |
}
|
| 27 |
|
| 28 |
def __init__(self,
|
| 29 |
+
ckpt_dir="src/generate_utils/lib/ckpt/pressurepose_20251222_180032",
|
| 30 |
+
smpl_model_dir="src/smpl_models",
|
| 31 |
device="cpu"):
|
| 32 |
"""
|
| 33 |
初始化生成器:加载配置、权重和 SMPL 模型。
|
|
|
|
| 58 |
def _load_config(self):
|
| 59 |
config_path = os.path.join(self.ckpt_dir, 'config.yaml')
|
| 60 |
if not os.path.exists(config_path):
|
| 61 |
+
from huggingface_hub import snapshot_download
|
| 62 |
+
snapshot_download(
|
| 63 |
+
"yolozyk/PaGe",
|
| 64 |
+
local_dir="src/generate_utils/lib/ckpt/",
|
| 65 |
+
local_dir_use_symlinks=False,
|
| 66 |
+
ignore_patterns=["*.safetensors", ".gitattributes"],
|
| 67 |
+
)
|
| 68 |
with open(config_path, 'r') as f:
|
| 69 |
return yaml.safe_load(f)
|
| 70 |
|
|
|
|
| 76 |
from huggingface_hub import snapshot_download
|
| 77 |
snapshot_download(
|
| 78 |
"yolozyk/PaGe",
|
| 79 |
+
local_dir="src/generate_utils/lib/ckpt/",
|
| 80 |
local_dir_use_symlinks=False,
|
| 81 |
ignore_patterns=["*.safetensors", ".gitattributes"],
|
| 82 |
)
|