Adapted from the original from the ScaNet Github.
Note that the segments for the validation scenes are already available the *.segs.json
files.
Mesh segmentation code using Felzenswalb and Huttenlocher's Graph Based Image Segmentation algorithm on computed mesh normals.
To compile the segmentator code, navigate to the segmentor directory:
cd box2mask/dataprocessing/oversegmentation/cpp
Set CMAKE_SOURCE_DIR={path_to_project_director}/dataprocessing/oversegmentation/cpp
in Makefile
where {path_to_project_director}
is the path to the project home directory.
Build by running make
(or create makefiles for your system using cmake
). This will create a segmentator
binary that can be called to generate segmentation:
To see if it works, try:
./segmentator input.ply [kThresh=0.01] [segMinVerts=20]
For example:
./segmentator ../../../data/scannet/scans/scene0011_00/scene0011_00_vh_clean_2.ply 0.01 20
- path to an input mesh in PLY format.
- the segmentation cluster threshold parameter, larger values lead to larger segments. (optional)
- the minimum number of vertices per-segment, enforced by merging small clusters into larger segments. (optional)
run_segments.py
visualize_segments.py