Skip to content

Commit ecef0fa

Browse files
committed
add pred_boxes
1 parent bafaa5f commit ecef0fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cpp/py_bindings/py_anomaly.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ void init_anomaly_detection(nb::module_& m) {
6565
static_cast<size_t>(r.anomaly_map.channels())});
6666
},
6767
nb::rv_policy::reference_internal)
68-
.def_ro("pred_boxes", &AnomalyResult::pred_boxes)
68+
.def_prop_ro(
69+
"pred_boxes",
70+
[](AnomalyResult& r) {
71+
return nb::ndarray<int, nb::numpy, nb::c_contig>(r.pred_boxes.data(),
72+
{static_cast<size_t>(r.pred_boxes.size()), 4});
73+
},
74+
nb::rv_policy::reference_internal)
6975
.def_ro("pred_label", &AnomalyResult::pred_label)
7076
.def_prop_ro(
7177
"pred_mask",

0 commit comments

Comments
 (0)