haofeixu / aanet

[CVPR'20] AANet: Adaptive Aggregation Network for Efficient Stereo Matching
Apache License 2.0
521 stars 100 forks source link

low contrast image warning #59

Closed aditdoshi333 closed 3 years ago

aditdoshi333 commented 3 years ago

Hello, I am trying to use predict.py for inference on a custom image stereo pair. But consistently I am getting the warning of low contrast images. I tried with different images but still, the warning is the same.

aditdoshi333 commented 3 years ago

This is the precise warning I am getting.

/home/mrobotics2/anaconda3/envs/aanet/lib/python3.7/site-packages/skimage/io/_io.py:141: UserWarning: dataset/pred/right_rect_p0_0_pred.png is a low contrast image warn('%s is a low contrast image' % fname)

Input: Left left_rect_p0_0

Right right_rect_p0_0

Output from the network left_rect_p0_0_pred

haofeixu commented 3 years ago

On possible reason can be that the images are not loaded correctly, thus the network is not able to produce reasonable output. Also, our network assumes rectified images as input.

aditdoshi333 commented 3 years ago

I am rectifying the images. What do you mean by images not loaded properly?

haofeixu commented 3 years ago

Are you runing our predict.py for prediction? The input images are firstly loaded to [0, 1], then normalization is applied. You can refer to the code here: https://github.com/haofeixu/aanet/blob/f689abf81ef072b4e50eb480d3a73db66eebda44/predict.py#L134-L138

aditdoshi333 commented 3 years ago

I am running predict.py only. And input images are getting loaded I checked that but then this warning of skimage is coming

warn('%s is a low contrast image' % fname)

haofeixu commented 3 years ago

Are you able to run our demo bash scripts/aanet_predict.sh successfully?

raylihaut commented 3 years ago

I have the same problem. I use KITTI2012 and KITTI2015 to test the trained model and the network outputs "**** is a low contrast image". How can I solve the problem?

JiazhiLiu commented 3 years ago

I also met the same problem, but finally found that it is because I did not load the right pretrained annet parameters. Make sure the right file ".pth" is on the folder.