init project
Browse files
app.py
CHANGED
@@ -495,29 +495,29 @@ def get_reconstructed_scene(outdir, filelist, schedule, niter, min_conf_thr,
|
|
495 |
print(e)
|
496 |
|
497 |
|
498 |
-
outfile = get_3D_model_from_scene(outdir, scene, min_conf_thr, as_pointcloud, mask_sky,
|
499 |
-
|
500 |
-
|
501 |
-
# also return rgb, depth and confidence imgs
|
502 |
-
# depth is normalized with the max value for all images
|
503 |
-
# we apply the jet colormap on the confidence maps
|
504 |
-
rgbimg = scene.imgs
|
505 |
-
depths = to_numpy(scene.get_depthmaps())
|
506 |
-
confs = to_numpy([c for c in scene.im_conf])
|
507 |
-
# confs = to_numpy([c for c in scene.conf_2])
|
508 |
-
cmap = pl.get_cmap('jet')
|
509 |
-
depths_max = max([d.max() for d in depths])
|
510 |
-
depths = [d / depths_max for d in depths]
|
511 |
-
confs_max = max([d.max() for d in confs])
|
512 |
-
confs = [cmap(d / confs_max) for d in confs]
|
513 |
-
|
514 |
-
imgs = []
|
515 |
-
for i in range(len(rgbimg)):
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
return scene, outfile, imgs
|
521 |
|
522 |
@spaces.GPU(duration=180)
|
523 |
def get_3D_object_from_scene(outdir, text, threshold, scene, min_conf_thr, as_pointcloud,
|
|
|
495 |
print(e)
|
496 |
|
497 |
|
498 |
+
# outfile = get_3D_model_from_scene(outdir, scene, min_conf_thr, as_pointcloud, mask_sky,
|
499 |
+
# clean_depth, transparent_cams, cam_size)
|
500 |
+
|
501 |
+
# # also return rgb, depth and confidence imgs
|
502 |
+
# # depth is normalized with the max value for all images
|
503 |
+
# # we apply the jet colormap on the confidence maps
|
504 |
+
# rgbimg = scene.imgs
|
505 |
+
# depths = to_numpy(scene.get_depthmaps())
|
506 |
+
# confs = to_numpy([c for c in scene.im_conf])
|
507 |
+
# # confs = to_numpy([c for c in scene.conf_2])
|
508 |
+
# cmap = pl.get_cmap('jet')
|
509 |
+
# depths_max = max([d.max() for d in depths])
|
510 |
+
# depths = [d / depths_max for d in depths]
|
511 |
+
# confs_max = max([d.max() for d in confs])
|
512 |
+
# confs = [cmap(d / confs_max) for d in confs]
|
513 |
+
|
514 |
+
# imgs = []
|
515 |
+
# for i in range(len(rgbimg)):
|
516 |
+
# imgs.append(rgbimg[i])
|
517 |
+
# imgs.append(rgb(depths[i]))
|
518 |
+
# imgs.append(rgb(confs[i]))
|
519 |
+
|
520 |
+
# return scene, outfile, imgs
|
521 |
|
522 |
@spaces.GPU(duration=180)
|
523 |
def get_3D_object_from_scene(outdir, text, threshold, scene, min_conf_thr, as_pointcloud,
|