Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ from huggingface_hub import hf_hub_download
|
|
| 15 |
import onnxruntime as ort
|
| 16 |
|
| 17 |
model_dict = {
|
| 18 |
-
"BallNet": "
|
| 19 |
}
|
| 20 |
|
| 21 |
vertices_dict = {}
|
|
@@ -42,19 +42,18 @@ cmin = 0.0
|
|
| 42 |
cmax = 12.0
|
| 43 |
|
| 44 |
|
| 45 |
-
def load_model(
|
| 46 |
-
repo_id = f"asRobotics/{model_name}"
|
| 47 |
model_filename = "model.onnx"
|
| 48 |
model_path = hf_hub_download(repo_id=repo_id, filename=model_filename)
|
| 49 |
return ort.InferenceSession(model_path)
|
| 50 |
|
| 51 |
|
| 52 |
ort_dict = {}
|
| 53 |
-
for name,
|
| 54 |
try:
|
| 55 |
-
ort_dict[name] = load_model(
|
| 56 |
except Exception as e:
|
| 57 |
-
print(f"Warning: Could not load model '{name}' from '{
|
| 58 |
|
| 59 |
|
| 60 |
def make_double_sided(mesh: trimesh.Trimesh) -> trimesh.Trimesh:
|
|
|
|
| 15 |
import onnxruntime as ort
|
| 16 |
|
| 17 |
model_dict = {
|
| 18 |
+
"BallNet": "han-xudong/ballnet",
|
| 19 |
}
|
| 20 |
|
| 21 |
vertices_dict = {}
|
|
|
|
| 42 |
cmax = 12.0
|
| 43 |
|
| 44 |
|
| 45 |
+
def load_model(repo_id):
|
|
|
|
| 46 |
model_filename = "model.onnx"
|
| 47 |
model_path = hf_hub_download(repo_id=repo_id, filename=model_filename)
|
| 48 |
return ort.InferenceSession(model_path)
|
| 49 |
|
| 50 |
|
| 51 |
ort_dict = {}
|
| 52 |
+
for name, repo_id in model_dict.items():
|
| 53 |
try:
|
| 54 |
+
ort_dict[name] = load_model(repo_id)
|
| 55 |
except Exception as e:
|
| 56 |
+
print(f"Warning: Could not load model '{name}' from '{repo_id}'. Error: {e}")
|
| 57 |
|
| 58 |
|
| 59 |
def make_double_sided(mesh: trimesh.Trimesh) -> trimesh.Trimesh:
|