During processing my own dataset with preprocess script, the original script always fails at writing depth image, reporting "cannot write mote F as PNG" from imageio.imwrite function. Turns out depth image is a float array generated from DPT, and can not be directly wrote to png file.
Also the depth image is not normalized, if directly converting to uint8, the depth image will have very low contrast.
Upon the above error, the pre-processing is broken due to exception and resulting depth image is not correctly generated. Therefore proposing two changes:
Change depth image data to uint8 format for png writing
Renormalizing depth image data to range 0-255 for high contrast.
During processing my own dataset with preprocess script, the original script always fails at writing depth image, reporting "cannot write mote F as PNG" from imageio.imwrite function. Turns out depth image is a float array generated from DPT, and can not be directly wrote to png file.
Also the depth image is not normalized, if directly converting to uint8, the depth image will have very low contrast.
Upon the above error, the pre-processing is broken due to exception and resulting depth image is not correctly generated. Therefore proposing two changes: