CVLAB-Unibo / Unsupervised-Adaptation-for-Deep-Stereo

Code for "Unsupervised Adaptation for Deep Stereo" - ICCV17
Apache License 2.0
62 stars 22 forks source link

Inference results from tensorflow version #11

Open horizon0408 opened 4 years ago

horizon0408 commented 4 years ago

Hi, I tried with the tensorflow verision and ran the inference code with the pretrained model you provide. I run with the command line --fullRes.

The images of the disparity map look pretty well. But when I save the disparity as a numpy array directly, I realized compared with ground truth, it seems to have some scaling problems: It looks like that the disparity values have been divided by 2. I have no idea why it happens.

I have two examples to explain my question. One from Flyingthings and one from KITTI https://drive.google.com/open?id=12ddoPxYLgetrO9KsmmLKzicPFA__uHhD https://drive.google.com/open?id=1xW3IX5Ys225cxBsAY5fjTP1Q_ReyzvUE

AlessioTonioni commented 4 years ago

How have you serialized the predicitons to numpy? Have you rescaled the input images?

horizon0408 commented 4 years ago

To get the predictions in numpy, I just run

disparity = full_res_prediction_np if args.fullRes else raw_prediction_np
np.save(dest[:-4], np.squeeze(disparity))

in your inference.py

The inputs are not rescaled. I run with command line --fullRes, and I also get the same size prediction as groud truth, which might confirm this.

AlessioTonioni commented 4 years ago

As far as I remember there was no scaling in the tensorflow version of the code. If you are only interested in inference with dispnet you can also refer to this codebase as the implementation (and weights) of dispnet should be the same. https://github.com/CVLAB-Unibo/Real-time-self-adaptive-deep-stereo