Skip to content

Commit

Permalink
--Add CCSemanticObject binding
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 committed Aug 9, 2024
1 parent 82deb3c commit a6e4b16
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/esp/bindings/SceneBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,16 @@ void initSceneBindings(
.def("index", &LoopRegionCategory::index, "mapping"_a = "")
.def("name", &LoopRegionCategory::name, "mapping"_a = "");

// These two are (cyclically) referenced by multiple classes below, define
// These are (cyclically) referenced by multiple classes below, define
// the classes first so pybind has the type definition available when binding
// functions
py::class_<SemanticObject, SemanticObject::ptr> semanticObject(
m, "SemanticObject");
py::class_<CCSemanticObject, SemanticObject, CCSemanticObject::ptr>
ccSemanticObject(
m, "CCSemanticObject",
"This class exists to facilitate semantic object data access for "
"bboxes derived from connected component analysis.");
py::class_<SemanticRegion, SemanticRegion::ptr> semanticRegion(
m, "SemanticRegion");

Expand Down Expand Up @@ -234,6 +239,15 @@ void initSceneBindings(
.def_property_readonly("obb", &SemanticObject::obb)
.def_property_readonly("category", &SemanticObject::category);

// ==== CCSemanticObject =====
ccSemanticObject
.def_property_readonly("num_src_verts", &CCSemanticObject::getNumSrcVerts,
"The number of vertices in the connected "
"component making up this semantic object.")
.def_property_readonly("vert_set", &CCSemanticObject::getVertSet,
"A set of the vertices in the connected component "
"making up this semantic object.");

// ==== SemanticScene ====
py::class_<SemanticScene, SemanticScene::ptr>(m, "SemanticScene")
.def(py::init(&SemanticScene::create<>))
Expand Down

0 comments on commit a6e4b16

Please sign in to comment.