hmorimitsu / ptlflow

PyTorch Lightning Optical Flow models, scripts, and pretrained weights.
Apache License 2.0
251 stars 33 forks source link

question about flow definition #72

Closed Cai-RS closed 1 month ago

Cai-RS commented 1 month ago

Hello, thanks for your job! I want to know that, if the output of all the flow model is " coordinate of matching point in the latter image - coordinate of matching point in the latter image", (X_img2 - X_img1, Y_img2 - Y_img1)? Or is it the opposite calculation method(X_img1 - X_img2, Y_img1 - Y_img2)?

nihalgupta84 commented 1 month ago

works both way, u just need to check bidrection flow available or not

hmorimitsu commented 1 month ago

Hello.

The usual output (which is inside inputs["flows"], for example) is according to your first definition, which can also be written as coords_img2 = coords_img1 + flow. The opposite direction is stored as "flows_b" and is usually only available when the bidirectional flow is used, as mentioned by @nihalgupta84 .

Best.

Cai-RS commented 1 month ago

Hello.

The usual output (which is inside inputs["flows"], for example) is according to your first definition, which can also be written as coords_img2 = coords_img1 + flow. The opposite direction is stored as "flows_b" and is usually only available when the bidirectional flow is used, as mentioned by @nihalgupta84 .

Best.

Get it! Thanks a lot!