Skip to content

Commit cd91bdb

Browse files
committed
Filter invalid iseg boxes in cpp to match python
1 parent c3998dc commit cd91bdb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

model_api/cpp/models/src/instance_segmentation.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ std::unique_ptr<ResultBase> MaskRCNNModel::postprocess(InferenceResult& infResul
356356
obj.height = clamp(
357357
round((boxes[i * objectSize + 3] - padTop) * invertedScaleY - obj.y),
358358
0.f, floatInputImgHeight);
359+
360+
if (obj.height * obj.width <= 1) {
361+
continue;
362+
}
363+
359364
cv::Mat raw_cls_mask{masks_size, CV_32F, masks + masks_size.area() * i};
360365
cv::Mat resized_mask;
361366
if (postprocess_semantic_masks || has_feature_vector_name) {

0 commit comments

Comments
 (0)