-
-
Notifications
You must be signed in to change notification settings - Fork 939
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
find_essential and run_5point are not working correctly with batch size>1 #2904
Comments
@shekhovt thanks for this finding ! What do you suggest, to add an empty tensor when we skip ? Are you open to fix and ideally expand the tests with this corner case ? /cc @weitong8591 as originally implemented this :) |
In the 'continue' cases it can be fixed by For the tests, if you have a correctness test of batch_size = 1, then it is easy to test also batch_size > 1, right? |
Hi, thanks for pointing out the missing batch indices (shape difference) due to the filters, i will soon have time to fix it. @edgarriba . probably as you said @shekhovt, to return identity matrices when it fails to make sure to return results for all batches. |
Hi @shekhovt , I encountered this problem as well and made modifications to the code, which now works stably for my training with a batch size of 256. You can find my implementation in the codebase for vggsfm: I addressed the kornia/kornia/geometry/epipolar/essential.py Line 149 in bdd07f3
You could have a try on this implementation if in a hurry. Tong @weitong8591 will review this implementation and merge it to kornia soon. |
Hi, thanks a lot! Good job with batching all the components, would be good to merge that to kornia. And an excellent paper too! I was using poselib in the meantime. I will try some of your primitives. |
Describe the bug
The problem is with run_5point solver, which has several filters:
kornia/kornia/geometry/epipolar/essential.py
Line 124 in a041d92
kornia/kornia/geometry/epipolar/essential.py
Line 161 in a041d92
kornia/kornia/geometry/epipolar/essential.py
Line 164 in a041d92
All of which can skip processing a batch index without appending anything to the output list E_models. The correspondence between index in this list and the index in the batch is lost.
In the result the shape of the returned tensor will be less than 10*B and it is not possible to determine for which batch indices there were no solution.
The solver is used in find_essential.
Reproduction steps
Expected behavior
Expecting output of shape
(B*10, 3,3)
Although the doctoring says "computed essential matrix with shape :math:
(B, 3, 3)
.", the code returns 10 solutions per batch index when not skipping.Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: