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.93k stars 1.11k forks source link

Custom Depth Map Error #63

Closed GregoryBetsey closed 4 years ago

GregoryBetsey commented 4 years ago

Hello

I am using a custom depth map on an image. I set the parameters in the to the following:

img_format: '.jpg' depth_format: '.png' require_midas: False

When I run argument.yml I get the following error:

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 "C:\Users\gregb\Documents\Python\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

I don't know what this error means.

reliro commented 4 years ago

Hello

I am using a custom depth map on an image. I set the parameters in the to the following:

img_format: '.jpg' depth_format: '.png' require_midas: False

When I run argument.yml I get the following error:

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 "C:\Users\gregb\Documents\Python\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

I don't know what this error means.

Hi I'm facing the exact same issue. Did you find a fix?

LemonATsu commented 4 years ago

Try saving the custom depth maps in grayscale and see if it works.

reliro commented 4 years ago

It worked after processing the depth map into a grayscale with cv2.imread("depth.png", cv2.IMREAD_GRAYSCALE) before giving it to the program!

VjayalakshmiK commented 3 years ago

Hi, with custom depth map, was the output looking good? To read_Midas_depth, what value of scale were you passing? I think I am having issues with this scale factor and my output is not aligned to the groundtruth frame. Do you have any suggestions?

kingsae1 commented 2 years ago

read_Midas_depth

Could you explain the solve with grayscale (i am solved with it). ^^

XXXXemberXXXX commented 4 months ago

Try saving the custom depth maps in grayscale and see if it works.

how to do that

XXXXemberXXXX commented 4 months ago

read_Midas_depth

Could you explain the solve with grayscale (i am solved with it). ^^

How to solve this