JiaRenChang / PSMNet

Pyramid Stereo Matching Network (CVPR2018)
MIT License
1.43k stars 423 forks source link

About the crop size 544*960 #30

Closed chenchr closed 6 years ago

chenchr commented 6 years ago

Hello. Thank you for the paper and code. I an confused about the dataloader for sceneflow dataset. As the image size of the dataset is 540940, however, when in test mode, the code crop the image to 544960..

else:
           w, h = left_img.size
           left_img = left_img.crop((w-960, h-544, w, h))
           right_img = right_img.crop((w-960, h-544, w, h))
           processed = preprocess.get_transform(augment=False)  
           left_img       = processed(left_img)
           right_img      = processed(right_img)

           return left_img, right_img, dataL

Could you explain why it is doing for ? Thanks!

JiaRenChang commented 6 years ago

Hi, we want to pad the width and height of images to multiple of 32.

chenchr commented 6 years ago

Oh... Thanks for your reply. So for any pair of stereo image, I need to pad it if I use PSMNet to predict the disparity ?

JiaRenChang commented 6 years ago

Yes. If image size is not appropriate, the feature may not to sum them because the dimension.

chenchr commented 6 years ago

Thanks!