From 12945dff7dddc825f9b72fe436848709cfb40ca0 Mon Sep 17 00:00:00 2001 From: Tadhg McDonald-Jensen Date: Thu, 26 Nov 2020 16:31:04 -0500 Subject: [PATCH 1/2] corrected numpy concat using scores = [scores, x] is not at all what you want to do This is how concatenation is done in matlab but in python it creates a nested list --- layers/output_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/output_utils.py b/layers/output_utils.py index 27efac935..36fcc9302 100644 --- a/layers/output_utils.py +++ b/layers/output_utils.py @@ -85,7 +85,7 @@ def postprocess(det_output, w, h, batch_idx=0, interpolation_mode='bilinear', if cfg.rescore_bbox: scores = scores * maskiou_p else: - scores = [scores, scores * maskiou_p] + scores = np.concatenate(scores, scores * maskiou_p) # Scale masks up to the full image masks = F.interpolate(masks.unsqueeze(0), (h, w), mode=interpolation_mode, align_corners=False).squeeze(0) From 572e71aff16bad65a03877899e0632006ec8de5b Mon Sep 17 00:00:00 2001 From: Tadhg McDonald-Jensen Date: Thu, 26 Nov 2020 17:01:42 -0500 Subject: [PATCH 2/2] fixed incorrect use of np.concatenate --- layers/output_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layers/output_utils.py b/layers/output_utils.py index 36fcc9302..57670ee77 100644 --- a/layers/output_utils.py +++ b/layers/output_utils.py @@ -85,7 +85,8 @@ def postprocess(det_output, w, h, batch_idx=0, interpolation_mode='bilinear', if cfg.rescore_bbox: scores = scores * maskiou_p else: - scores = np.concatenate(scores, scores * maskiou_p) + scores = np.concatenate( + (scores, scores * maskiou_p)) # Scale masks up to the full image masks = F.interpolate(masks.unsqueeze(0), (h, w), mode=interpolation_mode, align_corners=False).squeeze(0)