Skip to content

Commit

Permalink
add bounding box min and max properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhhughes committed Dec 12, 2024
1 parent de79f15 commit 3ead9c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/bindings/spark_dsg_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ PYBIND11_MODULE(_dsg_bindings, module) {
.def("compute_iou",
static_cast<float (BoundingBox::*)(const BoundingBox&) const>(
&BoundingBox::computeIoU))
.def_property_readonly("min",
[](const BoundingBox& box) {
return box.pointToWorldFrame(-box.dimensions / 2);
})
.def_property_readonly("max",
[](const BoundingBox& box) {
return box.pointToWorldFrame(box.dimensions / 2);
})
.def("__repr__", [](const BoundingBox& box) {
std::stringstream ss;
ss << box;
Expand Down

0 comments on commit 3ead9c8

Please sign in to comment.