Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluating PSMNet on KITTI VO with Pretrained KITTI-2012 model delivers biased and skewed disparity results #113

Closed
WASCHMASCHINE opened this issue Feb 26, 2019 · 9 comments

Comments

@WASCHMASCHINE
Copy link

WASCHMASCHINE commented Feb 26, 2019

I have looked at the KITTI Stereo 2012 dataset, which features parts of the KITTI VO dataset. I conclude that they are part of the same set. This means that I can just use the pretrained 2012 model.
Now, when I evaluate it on sequence 04 of the VO dataset, my disparity values seem to be off compared to ELAS and other stereo algorithms:

grafik

Also I tried out the other pretrained models. I compared the velodyne projected to the color image. Also, I altered/improved the velodyne to camera calibration, which is somewhat off for the VO dataset.

COMMAND USED: python submission.py --KITTI 2012 --datapath C:\KittiOdometry\data_odometry_color\dataset\sequences\04\ --loadmodel pretrained_model_KITTI2012.tar
Note that I altered the KITTI_submission_loader2012.py to work with KITTI VO instead.

Here's my resulting image of the first pair:
result

Here are the two input pictures. It would be really nice if somebody would post their disparity results of these two images with the pretrained KITTI 2012 model and hourglass. Then we could have a comparison and identify the source of the error faster.

left
right

@WASCHMASCHINE
Copy link
Author

@JiaRenChang Any advice?

@JiaRenChang
Copy link
Owner

@WASCHMASCHINE
Hi, I would like to know that the sequence 04 of the VO dataset performs badly?

Here is my testing result, I think it is same as your testing result.
vo

@WASCHMASCHINE
Copy link
Author

WASCHMASCHINE commented Mar 8, 2019

@JiaRenChang I think I see no difference between our images.

I decided to evaluate the KITTI2015 model on the KITTI2015 training. It still looks quite off, maybe my evaluation code is wrong? But other disparity results look OK. Please disregard the oversampling.

grafik

My comparison code looks like this:
Importer

newFrame10.groundTruthDisparityImage = cv::imread(_filepath + "\\data_scene_flow\\training\\disp_noc_0\\" + scenePaddingString + "_10.png", CV_LOAD_IMAGE_UNCHANGED);
newFrame10.groundTruthDisparityImage.convertTo(newFrame10.groundTruthDisparityImage, CV_32FC1, 1.0f / 256.0f); //UINT16 -> FLOAT32
newFrame10.precomputedDisparityImage = cv::imread(_filepath + "\\precomputed_psmnet_disparities\\" + scenePaddingString + "_10.png", CV_LOAD_IMAGE_UNCHANGED);
newFrame10.precomputedDisparityImage.convertTo(newFrame10.precomputedDisparityImage, CV_32FC1, 1.0f / 256.0f); //UINT16 -> FLOAT32

Evaluation

float gtDisparity = groundTruthDisparity.at<float>(imageHeight - 1 - v, u);
float reconstructedDisparity = stereoDisparity.at<float>(imageHeight - 1 - v, u);
if (gtDisparity <= 0) continue; // No ground truth available
if (!isnormal(reconstructedDisparity) || reconstructedDisparity <= 0.0f ) continue;
float deltaDisparity = reconstructedDisparity - gtDisparity;

Have you computed the error on the training dataset?

@WASCHMASCHINE
Copy link
Author

WASCHMASCHINE commented Mar 12, 2019

I ran the devkit sample from KITTI 2015 and implemented the accuracy measure in my code again.
Using the NOC GT I compared the disparity error: They look the same and pretty good (example frame 154: 1.35% accuracy). But I use the same error for my distribution. I conclude that the results of PSMNet are biased, but still very good in terms of KITTI accuracy. Subtracting -1.25 px per pixel from the reconstructed disparities decreased the error even further! @JiaRenChang I would suggest that you may try out evaluating PSMNet with a bias correction.

Avg. Accuracy on Kitti 2015 Training (200 frames, quick hack)
0.91 % Vanilla
0.67 % With -1.25 px on disparities

@JiaRenChang
Copy link
Owner

@WASCHMASCHINE

Wow, many thanks for your detailed evaluation!
It is interesting that why PSMNet is biased for 1.25 px.
I will try to figure out it.
Thanks again!!

@Sarah20187
Copy link

@WASCHMASCHINE For KITTI2015, if I trained PSMNet (finetuned from sceneflow dataset) on 160 frames and test on the rest 40 frames, -1.25 px on disparities cannot get a better result in my experiment.

@WASCHMASCHINE
Copy link
Author

@zhFuECL Why don't you compute a disparity error histogram like I did?

I used the whole training set of Kitti 2015 to compute the histogram, looked up the bias, and reevaluated it on the training set. I used the pretrained model from the author without modifications for disparities.

@WASCHMASCHINE
Copy link
Author

WASCHMASCHINE commented Jun 5, 2019

@JiaRenChang Any news on the topic?
I tested the pretrained_model of 2015 with the devkit matlab scripts and it looked similar but not the same as your result image on the KITTI website. I am not sure what's going on -- do I have to finetune the pretrained model?

@tv12345
Copy link

tv12345 commented Sep 17, 2019

Hello @WASCHMASCHINE did you use the standard 1242x375 images from the KITTI-2015 testing image folder? or did you scale them down to a lower resolution?
I am trying to get the algorithm working with the pretrained model provided to calculate depth on Jeston TX2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants