Giter VIP home page Giter VIP logo

Comments (6)

ClementPinard avatar ClementPinard commented on June 5, 2024

I think it will pose some problems because with warping you will compare image parts with black areas. The optimizer will try to avoid it to minimize photometric error.

To my mind, your best solution is to weight the photometric error for each pixel. If you know exactly the pixels to dismiss, just multiply these photometric loss values by 0

You can find an example of how I did the same thing with out of bound warped pixels in loss_functions.py

from sfmlearner-pytorch.

gilmartinspinheiro avatar gilmartinspinheiro commented on June 5, 2024

Thank you for your answer! :)
That makes a lot of sense. I will implement it and get back to you as soon as possible!

from sfmlearner-pytorch.

lliuz avatar lliuz commented on June 5, 2024

Hi, @ClementPinard
I have carefully read how you did for the out of bound warped pixels in loss_functions.py, but I am wondering when the pose or depth is not very accurate, such as at the begin of training, there might be a lot of pixels out of bound. Since we multiply these photometric loss values by 0, the photometric loss will be quite small. I think it will lead the network to divergence.
I have this problem when I use it in other scenarios. Do you have any experience dealing with it?

from sfmlearner-pytorch.

ClementPinard avatar ClementPinard commented on June 5, 2024

Normally it should not be a problem. At first, pose values are very low, so warping is very close to the identity function, which makes the gradient meaningful.
If you actually have out of bound pixels, then the difference won't have any gradient, because you are comparing a valid pixel to a grey zone on which no gradient is possible.

So discarding it from the loss value is just a way to have a more meaningful loss since you only deal with valid comparisons. This makes sense at the end of the training, where half of warping is zooming out to warp, with obvious out of bound pixels in the boundaries of the target image.

from sfmlearner-pytorch.

ClementPinard avatar ClementPinard commented on June 5, 2024

What scenario are you using it on ? A known problem is when translation is not enough, then the depth has very little influence on the warping since the parallax is low.

You can try the train_flexible_shift.py script which tries to overcome this problem by increasing temporal shift between frames when the translation predicted is too low.

from sfmlearner-pytorch.

lliuz avatar lliuz commented on June 5, 2024

Thank you for your prompt reply. I think you are right and I have fixed my problem. The divergence in my work is just because of a stupid typo.

from sfmlearner-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.