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

A small detail question about dense-flow #52

Open
chen9run opened this issue Mar 18, 2024 · 1 comment
Open

A small detail question about dense-flow #52

chen9run opened this issue Mar 18, 2024 · 1 comment

Comments

@chen9run
Copy link

The work is very exciting! I ask about the scaling process in the following code. Why divide by 4 here? Isn't ins * diaplacement[] supposed to restore to the original image, and /w is to normalize the result?
dense_flow = torch.stack(
(
dense_flow[:, 0] + ins * displacement[:, 0] / (4 * w),
dense_flow[:, 1] + ins * displacement[:, 1] / (4 * h),
),
dim=1,
)

@Parskatt
Copy link
Owner

Actually you can use any constant you want, as long as you use h,w. You could use 1.3 or 7.5 etc. If you want the model to output exactly in pixel coords you use 1/(0.5h). The 4 is simply that I thought it would make stuff about variance 1 (probably not true in practice).

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

2 participants