Git Product home page Git Product logo

Comments (2)

sniklaus avatar sniklaus commented on September 18, 2024 1

Don't forget that the input to backwarp isn't normalized images but features - and I also appended an additional channel:

tenInput = torch.cat([ tenInput, backwarp_tenPartial[str(tenFlow.shape)] ], 1)

Anyways, the reason I added this additional channel and why I mask the output based on this auxiliary channel is because the goal of this repository is to mimic the original Caffe implementation in PyTorch. That includes being able to use the weights from the model trained in Caffe and executing it in PyTorch. For that to work, all details need to be the same. This being said, the original Caffe implementation uses a custom backwarp implementation that only backwarps pixels if all four pixels that are being sampled reside inside of the image: https://github.com/NVlabs/PWC-Net/blob/185b0e2beb45ad029bb66d818812f8dcc2aed9c6/Caffe/warping_code/warp_layer.cu#L54-L85

The auxiliary channel/mask that I introduced is used to zero out pixels that sample from the boundary where the original implementation yields zero but PyTorch's grid sampler yields something different. If you train a PWC-Net from scratch then you can safely remove this mechanism.

from pytorch-pwc.

Etienne66 avatar Etienne66 commented on September 18, 2024

Thanks @sniklaus, I'm training from scratch and I did notice a slight improvement in the losses when I removed that. Glad to know it is safe to remove for a fresh training.

from pytorch-pwc.

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.