Spaces:
Running
on
Zero
Running
on
Zero
haotongl
commited on
Commit
·
90ae7e5
1
Parent(s):
439c90f
inital version
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ import cv2
|
|
15 |
import numpy as np
|
16 |
import imageio
|
17 |
# from promptda.promptda import PromptDA
|
18 |
-
from promptda.utils.io_wrapper import load_image, load_depth
|
19 |
-
from promptda.utils.depth_utils import visualize_depth, unproject_depth
|
20 |
# import torch
|
21 |
DEVICE = 'cuda'
|
22 |
# if torch.cuda.is_available(
|
@@ -44,7 +44,7 @@ def delete_later(path: Union[str, os.PathLike], delay: int = 300):
|
|
44 |
atexit.register(_delete)
|
45 |
|
46 |
|
47 |
-
@spaces.GPU
|
48 |
def run_with_gpu(image, prompt_depth):
|
49 |
image = image.to(DEVICE)
|
50 |
prompt_depth = prompt_depth.to(DEVICE)
|
@@ -57,6 +57,7 @@ def check_is_stray_scanner_app_capture(input_dir):
|
|
57 |
assert os.path.exists(os.path.join(input_dir, 'rgb.mp4')), 'rgb.mp4 not found'
|
58 |
pass
|
59 |
|
|
|
60 |
def run(input_file, resolution):
|
61 |
# unzip zip file
|
62 |
input_file = input_file.name
|
|
|
15 |
import numpy as np
|
16 |
import imageio
|
17 |
# from promptda.promptda import PromptDA
|
18 |
+
# from promptda.utils.io_wrapper import load_image, load_depth
|
19 |
+
# from promptda.utils.depth_utils import visualize_depth, unproject_depth
|
20 |
# import torch
|
21 |
DEVICE = 'cuda'
|
22 |
# if torch.cuda.is_available(
|
|
|
44 |
atexit.register(_delete)
|
45 |
|
46 |
|
47 |
+
# @spaces.GPU
|
48 |
def run_with_gpu(image, prompt_depth):
|
49 |
image = image.to(DEVICE)
|
50 |
prompt_depth = prompt_depth.to(DEVICE)
|
|
|
57 |
assert os.path.exists(os.path.join(input_dir, 'rgb.mp4')), 'rgb.mp4 not found'
|
58 |
pass
|
59 |
|
60 |
+
@spaces.GPU
|
61 |
def run(input_file, resolution):
|
62 |
# unzip zip file
|
63 |
input_file = input_file.name
|