Closed nnop closed 11 months ago
We actually haven't tried this out - very nice! This will indeed be much slower than C++ cost functions for large problems because the GIL prevents evaluating costs in parallel, but this is nonetheless very useful for debugging! Would you mind submitting a PR with set_num_residuals
and a simple test script? Thank you.
Sure, submited.
Thanks for this awesome wrapping library for ceres. In https://github.com/cvg/pyceres/issues/20, you said:
However, I have noticed that
PyCostFunction
already provides the corresponding trampoline functionality. The only thing that needs to be added is the encapsulation ofset_num_residuals()
. Which is done as follows:After adding it, I tested the helloworld CostFunction in Python. It seems ok.
The output is:
I am not sure if this approach has any issues or if it can be scaled to larger problems. Looking forward to your comments.