Open duyanwei opened 3 years ago
I got the png file with (384, 224, 3) shape. But I read the raw file and got the shape like:
import numpy as np
input_file = 'path/to/rawimage.raw'
npimg = np.fromfile(input_file, dtype=np.uint16)
npimg
has the shape of 172042. How to resize the raw shape? What's the difference between raw and png file?
Thank you for sharing this great work!
I've been playing with the demo and find this difference by making the following changes:
color_fmt = pjoin(self.base_dir, "color_down_png", "frame_{:06d}.png") # load .png file
else
branch here to load image withopencv
method, originally the.raw
format is loaded. https://github.com/facebookresearch/consistent_depth/blob/e2c9b724d3221aa7c0bf89aa9449ae33b418d943/loaders/video_dataset.py#L30print(f'{torch.min(depth)} {torch.max(depth)} {torch.mean(depth)}')
after this line: https://github.com/facebookresearch/consistent_depth/blob/e2c9b724d3221aa7c0bf89aa9449ae33b418d943/depth_fine_tuning.py#L190CMD
python main.py --video_file data/videos/ayush.mp4 --path results/ayush --camera_params "1671.770118, 540, 960" --camera_model "SIMPLE_PINHOLE" --make_video --model_type monodepth2
Results (only the first 5 frames are attached because of space limit):
(The order is
dmin
,dmax
,dmean
in each row).raw format
.png format
Does it make sense?