hujiecpp commited on
Commit
8e746f8
·
1 Parent(s): bf287f9

init project

Browse files
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -498,26 +498,26 @@ def get_reconstructed_scene(outdir, filelist, schedule, niter, min_conf_thr,
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,
 
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,