This is the guideline and structual explanation of the Python implementation of the EMS algorithm.
The code is tested under Python 3.8.8, but should have little compatibility concerns. The following packages are required to run the EMS algorithm:
- numpy 1.19.2
- scipy 1.5.2
- numba 0.53.1 -- for acceleration based on JIT (Just-In-Time compiler)
For demo, the following packages are needed:
- plyfile -- for loading
.ply
point cloud files - mayavi -- for visualization of meshes and point clouds
We recommend to install the EMS package with pip
.
- Change directory to
/Python
- Install package:
pip install .
The demo script is /Python/tests/test_script.py
.
The demo reads a .ply
point cloud and returns the parameters of the recovered superquadric, runtime, and visualization as required.
For example, in terminal type in
python test_script.py *.ply file location* --result --runtime --visualize
Note the first run of the code takes longer, since the JIT will translate the Python and NumPy code into fast machine code (and will be cached for futher calls).