Skip to content

Commit

Permalink
fix bug in postprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
Boomerl committed Oct 8, 2023
1 parent 6ff5c9b commit 985226a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion csrc/mmdeploy/codebase/mmdet/instance_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ResizeInstanceMask : public ResizeBBox {
int resize_width = int(mask_width / scale_factor_[1] + 0.5);
// skip resize if scale_factor is 1.0
if (resize_height != mask_height || resize_width != mask_width) {
cv::resize(mask_mat, mask_mat, cv::Size(resize_height, resize_width), cv::INTER_LINEAR);
cv::resize(mask_mat, mask_mat, cv::Size(resize_width, resize_height), cv::INTER_LINEAR);
}
// crop masks
mask_mat = mask_mat(cv::Range(0, img_h), cv::Range(0, img_w)).clone();
Expand Down
2 changes: 1 addition & 1 deletion mmdeploy/codebase/mmdet/deploy/object_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def get_postprocess(self, *args, **kwargs) -> Dict:
params['score_thr'] = params['rcnn']['score_thr']
if 'mask_thr_binary' in params['rcnn']:
params['mask_thr_binary'] = params['rcnn']['mask_thr_binary']
if 'mask_thr_binary' in params:
if 'mask_thr_binary' or 'mask_thr' in params:
type = 'ResizeInstanceMask' # for instance-seg
# resize and crop mask to origin image
params['is_resize_mask'] = True
Expand Down

0 comments on commit 985226a

Please sign in to comment.