Closed KexianHust closed 4 years ago
Depth maps are expected to be of size 1080x1920 and in .pfm format. An example function for saving pfm-files can be found e.g. here: MiDaS/utils.py:write_pfm
Using that function, you could convert your predicted depth maps stored as png files like that:
import pathlib
from imageio import imread
import numpy as np
from utils import write_pfm
for f in pathlib.Path('./predictions/').glob('**/*.png'):
d = imread(f).astype(np.float32)
write_pfm(f.with_suffix('.pfm'), d)
Thanks for your reply! One more question: are these uint16 or uint8 png files? Do I need to multiple 256.0 when saving the depth maps?
Thank you!
Apart from the precision (16bit vs 8bit), this should not make a difference as depth predictions are (robustly, i.e. using median) scaled to match the ground truth scale before evaluating.
Hi, is there any example for saving the predicted depth? Thank you!