This PR adds an initial Python binding of selected AliceVision modules using SWIG.
To that effect, SWIG is added as an optional dependency to the project and some modifications are done to the code in order to get the modules to bind properly (see the Implementation remarks section).
This first version of this binding revolves around the sfmData and sfmDataIO modules, which allow to load, save and modify SfMData files. Some related modules have been partially binded to allow the access to some relevant classes, structures or functions.
The binding does not cover yet 100% of the sfmData module, as it contains many dependencies that are not easily binded (in particular dependencies to Eigen). The binding is expected to be extended gradually.
Additionally, unit tests in Python are added. They currently aim more at validating the binding itself than the actual functions, for which unit tests with Boost already exist. These tests are added to the CI run for Linux.
The build of the Python binding on Windows is out of the scope of this PR and will be solved in a future and dedicated pull request.
The Python API of AliceVision can be used as follows:
import aliceVision as av
data = av.sfmData.SfMData()
path = "/path/to/sfmdata/file.sfm"
av.sfmDataIO.load(data, path, av.sfmDataIO.ALL)
views = data.getViews()
Features list
[x] Add SWIG to the list of dependencies
[x] Update all the Docker images for the dependencies
[x] Bind initial modules in Python (sfmData, sfmDataIO, sensorDB and partial bindings of camera and hdr)
[x] Add unit tests in Python
[x] Add the binding compilation to the CI
[x] Run the Python unit tests in the CI
Implementation remarks
All references to HashMap, which was a type alias for std::map<K, V>, have been removed and replaced with the direct use of std::map.
HashMapPtr, which was a wrapper for HashMap<K, std::shared_ptr<V>>, has also been removed.
Description
This PR adds an initial Python binding of selected AliceVision modules using SWIG.
To that effect, SWIG is added as an optional dependency to the project and some modifications are done to the code in order to get the modules to bind properly (see the Implementation remarks section).
This first version of this binding revolves around the
sfmData
andsfmDataIO
modules, which allow to load, save and modify SfMData files. Some related modules have been partially binded to allow the access to some relevant classes, structures or functions.The binding does not cover yet 100% of the
sfmData
module, as it contains many dependencies that are not easily binded (in particular dependencies to Eigen). The binding is expected to be extended gradually.Additionally, unit tests in Python are added. They currently aim more at validating the binding itself than the actual functions, for which unit tests with Boost already exist. These tests are added to the CI run for Linux.
The build of the Python binding on Windows is out of the scope of this PR and will be solved in a future and dedicated pull request.
The Python API of AliceVision can be used as follows:
Features list
sfmData
,sfmDataIO
,sensorDB
and partial bindings ofcamera
andhdr
)Implementation remarks
HashMap
, which was a type alias forstd::map<K, V>
, have been removed and replaced with the direct use ofstd::map
.HashMapPtr
, which was a wrapper forHashMap<K, std::shared_ptr<V>>
, has also been removed.