10
10
from dataloader .depth .datasets import ScannetDataset , DemonDataset
11
11
from loss .depth_loss import compute_errors
12
12
from utils .utils import InputPadder
13
- from utils .visualization import viz_depth_tensor_from_monodepth2
13
+ from utils .visualization import viz_depth_tensor
14
14
15
15
device = torch .device ('cuda' if torch .cuda .is_available () else 'cpu' )
16
16
@@ -132,9 +132,9 @@ def validate_scannet(model,
132
132
133
133
if save_vis_depth :
134
134
filename = os .path .join (save_dir , '%04d_depth_pred.png' % valid_samples )
135
- viz_inv_depth = viz_depth_tensor_from_monodepth2 (1. / pred_depth .cpu (),
136
- return_numpy = True ,
137
- colormap = 'plasma' ) # [H, W, 3] uint8
135
+ viz_inv_depth = viz_depth_tensor (1. / pred_depth .cpu (),
136
+ return_numpy = True ,
137
+ colormap = 'plasma' ) # [H, W, 3] uint8
138
138
Image .fromarray (viz_inv_depth ).save (filename )
139
139
140
140
gt_depth = gt_depth .cpu ().numpy ()
@@ -271,9 +271,9 @@ def validate_demon(model,
271
271
272
272
if save_vis_depth :
273
273
filename = os .path .join (save_dir , '%04d.png' % valid_samples )
274
- viz_inv_depth = viz_depth_tensor_from_monodepth2 (1. / pred_depth .cpu (),
275
- return_numpy = True ,
276
- colormap = 'plasma' ) # [H, W, 3] uint8
274
+ viz_inv_depth = viz_depth_tensor (1. / pred_depth .cpu (),
275
+ return_numpy = True ,
276
+ colormap = 'plasma' ) # [H, W, 3] uint8
277
277
Image .fromarray (viz_inv_depth ).save (filename )
278
278
279
279
gt_depth = gt_depth .cpu ().numpy ()
@@ -402,8 +402,8 @@ def inference_depth(model,
402
402
pr_depth = pred_depth [0 ]
403
403
404
404
filename = os .path .join (output_path , os .path .basename (imgs [i ])[:- 4 ] + '.png' )
405
- viz_inv_depth = viz_depth_tensor_from_monodepth2 (1. / pr_depth .cpu (),
406
- return_numpy = True ) # [H, W, 3] uint8
405
+ viz_inv_depth = viz_depth_tensor (1. / pr_depth .cpu (),
406
+ return_numpy = True ) # [H, W, 3] uint8
407
407
Image .fromarray (viz_inv_depth ).save (filename )
408
408
409
409
if pred_bidir_depth :
@@ -412,8 +412,8 @@ def inference_depth(model,
412
412
pr_depth_bwd = pred_depth [1 ]
413
413
414
414
filename = os .path .join (output_path , os .path .basename (imgs [i ])[:- 4 ] + '_bwd.png' )
415
- viz_inv_depth = viz_depth_tensor_from_monodepth2 (1. / pr_depth_bwd .cpu (),
416
- return_numpy = True ) # [H, W, 3] uint8
415
+ viz_inv_depth = viz_depth_tensor (1. / pr_depth_bwd .cpu (),
416
+ return_numpy = True ) # [H, W, 3] uint8
417
417
Image .fromarray (viz_inv_depth ).save (filename )
418
418
419
419
print ('Done!' )
0 commit comments