Hey everyone,
I know there has been some discussion in the past regarding having some python bindings. Here is a project I have been hacking on over the past couple of weeks. It uses Pybind11 to wrap a good portion of Ceres.
I'll slowly add more functionality to it over the coming weeks. For basic stuff it seems to work quite well. If people have specific things they want wrapped let me know, and I''ll try to target that featureset.
This is also a post to generate some discussion on if something like this should be added to main Ceres.
Reasons for:
- Get access to a state of the art non linear least squares solver in Python.
- Allows one to unify Python and C++ code on a single solver.
Reasons against:
- Added maintenance costs
- For now: If you want any speed then the cost function needs to be defined in C++. This decreases the ease of use of this library, as the end user is now expected to write their own wrapping code for their cost function. (Note at my work this is not a problem as we codegen Python Wrappers for Cost Functions. However, this is not a tenable solution for other users)
- The main problem with Python defined cost functions is the GIL. As it means running Ceres with multiple threads is useless.