Spaces:
Runtime error
Runtime error
hengli commited on
Commit Β·
14eb51e
1
Parent(s): 66d73fb
update hf link
Browse files- app.py +1 -0
- sailrecon/models/sail_recon.py +2 -2
app.py
CHANGED
|
@@ -45,6 +45,7 @@ model = model.to(device)
|
|
| 45 |
# -------------------------------------------------------------------------
|
| 46 |
# 1) Core model inference
|
| 47 |
# -------------------------------------------------------------------------
|
|
|
|
| 48 |
def run_model(target_dir, model, anchor_size=100) -> dict:
|
| 49 |
"""
|
| 50 |
Run the SAIL-Recon model on images in the 'target_dir/images' folder and return predictions.
|
|
|
|
| 45 |
# -------------------------------------------------------------------------
|
| 46 |
# 1) Core model inference
|
| 47 |
# -------------------------------------------------------------------------
|
| 48 |
+
@spaces.GPU
|
| 49 |
def run_model(target_dir, model, anchor_size=100) -> dict:
|
| 50 |
"""
|
| 51 |
Run the SAIL-Recon model on images in the 'target_dir/images' folder and return predictions.
|
sailrecon/models/sail_recon.py
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
# This source code is licensed under the Apache License, Version 2.0
|
| 9 |
# found in the LICENSE file in the root directory of this source tree.
|
| 10 |
|
| 11 |
-
|
| 12 |
import torch
|
| 13 |
import torch.nn as nn
|
| 14 |
from huggingface_hub import PyTorchModelHubMixin # used for model hub
|
|
@@ -20,7 +20,7 @@ from sailrecon.models.aggregator import Aggregator
|
|
| 20 |
from sailrecon.utils.geometry import unproject_depth_map_to_point_map
|
| 21 |
from sailrecon.utils.pose_enc import pose_encoding_to_extri_intri
|
| 22 |
|
| 23 |
-
|
| 24 |
class SailRecon(nn.Module, PyTorchModelHubMixin):
|
| 25 |
def __init__(
|
| 26 |
self,
|
|
|
|
| 8 |
# This source code is licensed under the Apache License, Version 2.0
|
| 9 |
# found in the LICENSE file in the root directory of this source tree.
|
| 10 |
|
| 11 |
+
import spaces
|
| 12 |
import torch
|
| 13 |
import torch.nn as nn
|
| 14 |
from huggingface_hub import PyTorchModelHubMixin # used for model hub
|
|
|
|
| 20 |
from sailrecon.utils.geometry import unproject_depth_map_to_point_map
|
| 21 |
from sailrecon.utils.pose_enc import pose_encoding_to_extri_intri
|
| 22 |
|
| 23 |
+
@spaces.GPU
|
| 24 |
class SailRecon(nn.Module, PyTorchModelHubMixin):
|
| 25 |
def __init__(
|
| 26 |
self,
|