An implementation of alpha-expansion and graph cut in C++. This is
We use the Boost Graph library.
mkdir build && cd build/
cmake ../
make
or if you are using the command line on Linux:
./build.sh
Run the executable from the command line with
./Main path/to/folder
where the folder should contain the node potentials and edges as
nodes.txt
edges.txt
If you have a reference labels file named label_ref.txt
, you can have the program check the coherence by using the --check
flag:
./Main path/to/folder --check
Once this root C++ library is built or installed (e.g. using make install
), you can install Python bindings using setuptools:
cd python
python setup.py build_ext # with option --inplace for a local build
This requires Pybind11.
The data files (unary potentials and list of edges) included in this repository are generated in the context of a 3D point cloud classification challenge: its code can be found at https://github.com/JulesSanchez/npm3d-challenge. The soft labels are generated using the XGBoost algorithm with handcrafted input features (local covariance and shape features).
More details on the challenge can be found here: https://npm3d.fr/benchmark-for-master-course-on-3d-point-clouds
- https://hal.inria.fr/file/index/docid/617524/filename/sample2e.pdf
- http://akira.ruc.dk/~keld/teaching/algoritmedesign_f03/Artikler/08/Goldberg88.pdf
- Simon JD Prince, Computer vision: models, learning, and inference. URL: http://www0.cs.ucl.ac.uk/external/s.prince/book/Algorithms.pdf