Spaces:
Running
on
Zero
Running
on
Zero
increase limit
Browse files
app.py
CHANGED
@@ -26,15 +26,6 @@ model = model.to(device)
|
|
26 |
model.eval()
|
27 |
|
28 |
|
29 |
-
@spaces.GPU(duration=20)
|
30 |
-
def predict(frame):
|
31 |
-
image = transform(frame)
|
32 |
-
image = image.to(device)
|
33 |
-
prediction = model.infer(image)
|
34 |
-
depth = prediction["depth"].squeeze().detach().cpu().numpy()
|
35 |
-
return depth, prediction["focallength_px"].item()
|
36 |
-
|
37 |
-
|
38 |
@rr.thread_local_stream("rerun_example_ml_depth_pro")
|
39 |
def run_rerun(path_to_video):
|
40 |
stream = rr.binary_stream()
|
@@ -102,7 +93,7 @@ def run_rerun(path_to_video):
|
|
102 |
os.remove(path_to_video)
|
103 |
|
104 |
|
105 |
-
@spaces.GPU(duration=
|
106 |
def estimate_depth(frame):
|
107 |
image = transform(frame)
|
108 |
image = image.to(device)
|
|
|
26 |
model.eval()
|
27 |
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
@rr.thread_local_stream("rerun_example_ml_depth_pro")
|
30 |
def run_rerun(path_to_video):
|
31 |
stream = rr.binary_stream()
|
|
|
93 |
os.remove(path_to_video)
|
94 |
|
95 |
|
96 |
+
@spaces.GPU(duration=120)
|
97 |
def estimate_depth(frame):
|
98 |
image = transform(frame)
|
99 |
image = image.to(device)
|