Spaces:
Running
on
Zero
Running
on
Zero
CharlieAmalet
commited on
Update mesh.py
Browse files
mesh.py
CHANGED
@@ -26,6 +26,7 @@ def predict_depth(model, image):
|
|
26 |
depth = model.infer_pil(image)
|
27 |
return depth
|
28 |
|
|
|
29 |
def get_mesh(model, image: Image.Image, keep_edges=True):
|
30 |
image.thumbnail((1024,1024)) # limit the size of the input image
|
31 |
|
@@ -53,8 +54,7 @@ def get_mesh(model, image: Image.Image, keep_edges=True):
|
|
53 |
mesh.export(glb_path)
|
54 |
return glb_path
|
55 |
|
56 |
-
|
57 |
-
def mesh_interface(model):
|
58 |
with gr.Row():
|
59 |
with gr.Column():
|
60 |
inputs=[gr.Image(label="Input Image", type='pil'), gr.Checkbox(label="Keep occlusion edges", value=True)]
|
|
|
26 |
depth = model.infer_pil(image)
|
27 |
return depth
|
28 |
|
29 |
+
@spaces.GPU(enable_queue=True)
|
30 |
def get_mesh(model, image: Image.Image, keep_edges=True):
|
31 |
image.thumbnail((1024,1024)) # limit the size of the input image
|
32 |
|
|
|
54 |
mesh.export(glb_path)
|
55 |
return glb_path
|
56 |
|
57 |
+
def mesh_interface(model, device):
|
|
|
58 |
with gr.Row():
|
59 |
with gr.Column():
|
60 |
inputs=[gr.Image(label="Input Image", type='pil'), gr.Checkbox(label="Keep occlusion edges", value=True)]
|