- app.py +9 -3
- dust3r/cloud_opt_flow/base_opt.py +2 -0
app.py
CHANGED
@@ -103,7 +103,7 @@ def generate_monocular_depth_maps(img_list, depth_prior_name):
|
|
103 |
prediction = model.infer(image, f_px=f_px)
|
104 |
depth = prediction["depth"].cpu().numpy() # Depth in [m].
|
105 |
focallength_px=prediction["focallength_px"].cpu()
|
106 |
-
depth = cv2.resize(depth[0], image.size, interpolation=cv2.INTER_CUBIC)
|
107 |
depth_list.append(depth)
|
108 |
focallength_px_list.append(focallength_px)
|
109 |
#np.savez_compressed(path_depthpro, depth=depth, focallength_px=prediction["focallength_px"].cpu())
|
@@ -114,10 +114,9 @@ def generate_monocular_depth_maps(img_list, depth_prior_name):
|
|
114 |
image = Image.open(image_path)
|
115 |
#print(image.size)
|
116 |
depth = pipe(image)["predicted_depth"].numpy()
|
117 |
-
print(depth.max(),depth.min())
|
118 |
#depth = cv2.resize(depth[0], image.size, interpolation=cv2.INTER_CUBIC)
|
119 |
focallength_px = 200
|
120 |
-
print(depth.max(),depth.min())
|
121 |
depth_list.append(depth)
|
122 |
focallength_px_list.append(focallength_px)
|
123 |
#np.savez_compressed(path_depthanything, depth=depth)
|
@@ -194,6 +193,13 @@ with gradio.Blocks(css=css, title=title, delete_cache=(gradio_delete_cache, grad
|
|
194 |
[os.path.join(HERE_PATH, 'example/bear/00000.jpg'),
|
195 |
os.path.join(HERE_PATH, 'example/bear/00001.jpg'),
|
196 |
os.path.join(HERE_PATH, 'example/bear/00002.jpg'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
]
|
198 |
],
|
199 |
[
|
|
|
103 |
prediction = model.infer(image, f_px=f_px)
|
104 |
depth = prediction["depth"].cpu().numpy() # Depth in [m].
|
105 |
focallength_px=prediction["focallength_px"].cpu()
|
106 |
+
#depth = cv2.resize(depth[0], image.size, interpolation=cv2.INTER_CUBIC)
|
107 |
depth_list.append(depth)
|
108 |
focallength_px_list.append(focallength_px)
|
109 |
#np.savez_compressed(path_depthpro, depth=depth, focallength_px=prediction["focallength_px"].cpu())
|
|
|
114 |
image = Image.open(image_path)
|
115 |
#print(image.size)
|
116 |
depth = pipe(image)["predicted_depth"].numpy()
|
117 |
+
#print(depth.max(),depth.min())
|
118 |
#depth = cv2.resize(depth[0], image.size, interpolation=cv2.INTER_CUBIC)
|
119 |
focallength_px = 200
|
|
|
120 |
depth_list.append(depth)
|
121 |
focallength_px_list.append(focallength_px)
|
122 |
#np.savez_compressed(path_depthanything, depth=depth)
|
|
|
193 |
[os.path.join(HERE_PATH, 'example/bear/00000.jpg'),
|
194 |
os.path.join(HERE_PATH, 'example/bear/00001.jpg'),
|
195 |
os.path.join(HERE_PATH, 'example/bear/00002.jpg'),
|
196 |
+
os.path.join(HERE_PATH, 'example/bear/00003.jpg'),
|
197 |
+
os.path.join(HERE_PATH, 'example/bear/00004.jpg'),
|
198 |
+
os.path.join(HERE_PATH, 'example/bear/00005.jpg'),
|
199 |
+
os.path.join(HERE_PATH, 'example/bear/00006.jpg'),
|
200 |
+
os.path.join(HERE_PATH, 'example/bear/00007.jpg'),
|
201 |
+
os.path.join(HERE_PATH, 'example/bear/00008.jpg'),
|
202 |
+
os.path.join(HERE_PATH, 'example/bear/00009.jpg'),
|
203 |
]
|
204 |
],
|
205 |
[
|
dust3r/cloud_opt_flow/base_opt.py
CHANGED
@@ -25,6 +25,8 @@ from dust3r.utils.vo_eval import save_trajectory_tum_format
|
|
25 |
import os
|
26 |
import matplotlib.pyplot as plt
|
27 |
from PIL import Image
|
|
|
|
|
28 |
|
29 |
def c2w_to_tumpose(c2w):
|
30 |
"""
|
|
|
25 |
import os
|
26 |
import matplotlib.pyplot as plt
|
27 |
from PIL import Image
|
28 |
+
HERE_PATH = path.normpath(path.dirname(__file__))
|
29 |
+
print('**',HERE_PATH)
|
30 |
|
31 |
def c2w_to_tumpose(c2w):
|
32 |
"""
|