Update mvp.py
Browse files
mvp.py
CHANGED
|
@@ -68,7 +68,7 @@ from vggt.utils.load_fn import load_and_preprocess_images
|
|
| 68 |
from vggt.utils.pose_enc import pose_encoding_to_extri_intri
|
| 69 |
from vggt.utils.geometry import unproject_depth_map_to_point_map
|
| 70 |
|
| 71 |
-
@spaces.GPU()
|
| 72 |
def get_device():
|
| 73 |
return "cuda" if torch.cuda.is_available() else 'cpu'
|
| 74 |
|
|
@@ -130,7 +130,7 @@ def _ensure_mask2former_weights(dst_path: str) -> str:
|
|
| 130 |
shutil.copyfile(cached, dst_path)
|
| 131 |
return dst_path
|
| 132 |
|
| 133 |
-
@spaces.GPU()
|
| 134 |
def _init_models():
|
| 135 |
"""
|
| 136 |
Lazy-load heavy models so the UI can start quickly on HF Spaces.
|
|
@@ -224,7 +224,7 @@ clip_model = None
|
|
| 224 |
# -------------------------------------------------------------------------
|
| 225 |
# 1) Core model inference
|
| 226 |
# -------------------------------------------------------------------------
|
| 227 |
-
@spaces.GPU
|
| 228 |
def run_model(target_dir, model, metric3d_model=None) -> dict:
|
| 229 |
"""
|
| 230 |
Run the VGGT model on images in the 'target_dir/images' folder and return predictions.
|
|
|
|
| 68 |
from vggt.utils.pose_enc import pose_encoding_to_extri_intri
|
| 69 |
from vggt.utils.geometry import unproject_depth_map_to_point_map
|
| 70 |
|
| 71 |
+
# @spaces.GPU()
|
| 72 |
def get_device():
|
| 73 |
return "cuda" if torch.cuda.is_available() else 'cpu'
|
| 74 |
|
|
|
|
| 130 |
shutil.copyfile(cached, dst_path)
|
| 131 |
return dst_path
|
| 132 |
|
| 133 |
+
# @spaces.GPU()
|
| 134 |
def _init_models():
|
| 135 |
"""
|
| 136 |
Lazy-load heavy models so the UI can start quickly on HF Spaces.
|
|
|
|
| 224 |
# -------------------------------------------------------------------------
|
| 225 |
# 1) Core model inference
|
| 226 |
# -------------------------------------------------------------------------
|
| 227 |
+
# @spaces.GPU()
|
| 228 |
def run_model(target_dir, model, metric3d_model=None) -> dict:
|
| 229 |
"""
|
| 230 |
Run the VGGT model on images in the 'target_dir/images' folder and return predictions.
|