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

How to understand the values 0.625, 1.25, 2.5, 5.0 in the PWCNet.py #119

Open
poppinjie opened this issue Mar 26, 2021 · 6 comments
Open

Comments

@poppinjie
Copy link

I find that these values are multiplied by the upsampled optical flow.But I am not clear what's the meanning of these operations.Why the upsampled optical flow need to multiply corresponding float value?

@kajalsingh25111997
Copy link

I find that these values are multiplied by the upsampled optical flow.But I am not clear what's the meanning of these operations.Why the upsampled optical flow need to multiply corresponding float value?

I have the same question.Did you find its answer.

@poppinjie
Copy link
Author

I'm sorry! I don't know yet. Maybe we can explore it together.

1 similar comment
@poppinjie
Copy link
Author

I'm sorry! I don't know yet. Maybe we can explore it together.

@hmorimitsu
Copy link

These values are obtained after combining two factors:

  • The flow value predicted by PWCNet is 20 times smaller than the original value.
  • The stride of the layer where the flow is being used (how many times smaller the layer is, compared to the output).

So, the first value (0.625) is applied on a layer whose stride is 32. Since the flow needs to be increased by 20 times, to adapt the flow value to that layer, we need to multiply it by 20/32=0.625. The next layer has stride 16, so we use 20/16=1.25, and so on.

@poppinjie
Copy link
Author

poppinjie commented Jul 14, 2021 via email

@hmorimitsu
Copy link

The stride of a layer is a scalar value which represents how many times smaller that layer is compared to the input image. For example, if the input image size was 512x512, and the current layer size is 64x64, then this layer has stride 8.

Looking at the code here https://github.com/NVlabs/PWC-Net/blob/master/PyTorch/models/PWCNet.py, we see that self.conv1x layers will have layer stride 2, self.conv2x will have layer stride 4, and so on. Following this logic, self.conv5x will have layer stride 32, so the flow value in this layer is multiplied by 0.625 as explained in my previous answer. In the next stage, we will be handling the self.conv4x features, which have layer stride 16, so we multiply the flow by 1.25.

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

3 participants