vt-vl-lab / 3d-photo-inpainting

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting
https://shihmengli.github.io/3D-Photo-Inpainting/
Other
6.91k stars 1.11k forks source link

MiDaS Improve ? #69

Closed freeman5 closed 4 years ago

freeman5 commented 4 years ago

Hi,

I have bad issue with some picture, I have try depth extraction with your custom Midas, and the Midas from repository.

Video : IMG_8024_circle.zip

Your custom Midas Depth Image :

IMG_8024_custom

And the Midas Depth Image from original repository :

IMG_8024

I have use a simple tool for resize the second image for try to replace the first png depth image. I have modified argument for load the new depth png than generate new one but i get this message :

Current Source ==> IMG_8024 Running depth extraction at 1593257335.9546485 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "main.py", line 72, in vis_photos, vis_depths = sparse_bilateral_filtering(depth.copy(), image.copy(), config, num_iter=config['sparse_iter'], spdb=False) File "/root/3d-photo-inpainting/bilateral_filtering.py", line 31, in sparse_bilateral_filtering vis_image[u_over > 0] = np.array([0, 0, 0]) IndexError: boolean index did not match indexed array along dimension 2; dimension is 3 but corresponding boolean dimension is 5

What happen with my new image ? How to update your script with the last Midas ? Something go wrong when i use the model-f45da743.pt from here https://github.com/intel-isl/MiDaS/releases/download/v2/model-f46da743.pt more bigger than your model.pt ( Why ? ) Thank you for your work its amazing !!

reliro commented 4 years ago

I made it work by processing the depth map into a grayscale with cv2.imread("depth.png", cv2.IMREAD_GRAYSCALE) before giving it to the program!