DKM icon indicating copy to clipboard operation
DKM copied to clipboard

A small detail question about dense-flow

Open chen9run opened this issue 2 years ago • 1 comments

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, )

chen9run avatar Mar 18 '24 16:03 chen9run

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).

Parskatt avatar Mar 18 '24 17:03 Parskatt