Spaces:
Running
on
Zero
Running
on
Zero
add spaces
Browse files- app.py +2 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -26,6 +26,7 @@ from datetime import (
|
|
| 26 |
)
|
| 27 |
import cv2
|
| 28 |
import numpy as np
|
|
|
|
| 29 |
|
| 30 |
def prepare_to_run_demo():
|
| 31 |
config = load_config('configs/infer.json')
|
|
@@ -65,6 +66,7 @@ def ply2glb(ply_path, glb_path):
|
|
| 65 |
cloud.export(glb_path)
|
| 66 |
os.remove(ply_path)
|
| 67 |
|
|
|
|
| 68 |
def fn(image_path, mask_path):
|
| 69 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 70 |
name_base, _ = os.path.splitext(os.path.basename(image_path))
|
|
|
|
| 26 |
)
|
| 27 |
import cv2
|
| 28 |
import numpy as np
|
| 29 |
+
import spaces
|
| 30 |
|
| 31 |
def prepare_to_run_demo():
|
| 32 |
config = load_config('configs/infer.json')
|
|
|
|
| 66 |
cloud.export(glb_path)
|
| 67 |
os.remove(ply_path)
|
| 68 |
|
| 69 |
+
@spaces.GPU
|
| 70 |
def fn(image_path, mask_path):
|
| 71 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 72 |
name_base, _ = os.path.splitext(os.path.basename(image_path))
|
requirements.txt
CHANGED
|
@@ -16,4 +16,5 @@ einops==0.8.0
|
|
| 16 |
timm==1.0.15
|
| 17 |
trimesh==4.5.2
|
| 18 |
transformers==4.46.3
|
| 19 |
-
matplotlib==3.9.2
|
|
|
|
|
|
| 16 |
timm==1.0.15
|
| 17 |
trimesh==4.5.2
|
| 18 |
transformers==4.46.3
|
| 19 |
+
matplotlib==3.9.2
|
| 20 |
+
spaces==0.42.1
|