Spaces:
Running
on
Zero
Running
on
Zero
zoedepth gpu dec
Browse files- demo/mesh_recon.py +4 -0
demo/mesh_recon.py
CHANGED
@@ -4,6 +4,9 @@ import numpy as np
|
|
4 |
import torch
|
5 |
import trimesh
|
6 |
|
|
|
|
|
|
|
7 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
8 |
|
9 |
# use torch hub
|
@@ -96,6 +99,7 @@ def depth_edges_mask(depth):
|
|
96 |
return mask
|
97 |
|
98 |
|
|
|
99 |
def mesh_reconstruction(
|
100 |
masked_image: np.ndarray,
|
101 |
mask: np.ndarray,
|
|
|
4 |
import torch
|
5 |
import trimesh
|
6 |
|
7 |
+
import spaces
|
8 |
+
|
9 |
+
|
10 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
11 |
|
12 |
# use torch hub
|
|
|
99 |
return mask
|
100 |
|
101 |
|
102 |
+
@spaces.GPU
|
103 |
def mesh_reconstruction(
|
104 |
masked_image: np.ndarray,
|
105 |
mask: np.ndarray,
|