kxhit commited on
Commit
4de6d6a
1 Parent(s): b20dacb

gpu to numpy

Browse files
Files changed (1) hide show
  1. app.py +3 -20
app.py CHANGED
@@ -382,20 +382,9 @@ def get_reconstructed_scene(filelist, schedule, niter, min_conf_thr,
382
  if mode == GlobalAlignerMode.PointCloudOptimizer:
383
  loss = scene.compute_global_alignment(init='mst', niter=niter, schedule=schedule, lr=lr)
384
 
385
- # outfile = get_3D_model_from_scene(outdir, silent, scene, min_conf_thr, as_pointcloud, mask_sky,
386
- # clean_depth, transparent_cams, cam_size, same_focals=same_focals)
387
-
388
- # also return rgb, depth and confidence imgs
389
- # depth is normalized with the max value for all images
390
- # we apply the jet colormap on the confidence maps
391
- rgbimg = scene.imgs
392
- # depths = to_numpy(scene.get_depthmaps())
393
- # confs = to_numpy([c for c in scene.im_conf])
394
- # cmap = pl.get_cmap('jet')
395
- # depths_max = max([d.max() for d in depths])
396
- # depths = [d / depths_max for d in depths]
397
- # confs_max = max([d.max() for d in confs])
398
- # confs = [cmap(d / confs_max) for d in confs]
399
 
400
  imgs = []
401
  rgbaimg = []
@@ -413,12 +402,6 @@ def get_reconstructed_scene(filelist, schedule, niter, min_conf_thr,
413
 
414
  rgbaimg = np.array(rgbaimg)
415
 
416
- # for eschernet
417
- # get optimized values from scene
418
- rgbimg = to_numpy(scene.imgs)
419
- # focals = to_numpy(scene.get_focals().cpu())
420
- cams2world = to_numpy(scene.get_im_poses().cpu())
421
-
422
  # 3D pointcloud from depthmap, poses and intrinsics
423
  pts3d = to_numpy(scene.get_pts3d())
424
  scene.min_conf_thr = float(scene.conf_trf(torch.tensor(min_conf_thr)))
 
382
  if mode == GlobalAlignerMode.PointCloudOptimizer:
383
  loss = scene.compute_global_alignment(init='mst', niter=niter, schedule=schedule, lr=lr)
384
 
385
+ # for eschernet
386
+ cams2world = to_numpy(scene.get_im_poses().cpu())
387
+ rgbimg = to_numpy(scene.imgs)
 
 
 
 
 
 
 
 
 
 
 
388
 
389
  imgs = []
390
  rgbaimg = []
 
402
 
403
  rgbaimg = np.array(rgbaimg)
404
 
 
 
 
 
 
 
405
  # 3D pointcloud from depthmap, poses and intrinsics
406
  pts3d = to_numpy(scene.get_pts3d())
407
  scene.min_conf_thr = float(scene.conf_trf(torch.tensor(min_conf_thr)))