Skip to content

Commit

Permalink
Filter invalid iseg boxes in cpp to match python
Browse files Browse the repository at this point in the history
  • Loading branch information
sovrasov committed Feb 22, 2024
1 parent c3998dc commit cd91bdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions model_api/cpp/models/src/instance_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ std::unique_ptr<ResultBase> MaskRCNNModel::postprocess(InferenceResult& infResul
obj.height = clamp(
round((boxes[i * objectSize + 3] - padTop) * invertedScaleY - obj.y),
0.f, floatInputImgHeight);

if (obj.height * obj.width <= 1) {
continue;
}

cv::Mat raw_cls_mask{masks_size, CV_32F, masks + masks_size.area() * i};
cv::Mat resized_mask;
if (postprocess_semantic_masks || has_feature_vector_name) {
Expand Down

0 comments on commit cd91bdb

Please sign in to comment.