diff --git a/paddlex/cv/models/deeplabv3p.py b/paddlex/cv/models/deeplabv3p.py index 2880d4bcb40dade036ddbbd9b893a0231fa33015..a253aa5d1d8c005c7903b57a9b9b36da45982d78 100644 --- a/paddlex/cv/models/deeplabv3p.py +++ b/paddlex/cv/models/deeplabv3p.py @@ -400,14 +400,19 @@ class DeepLabv3p(BaseAPI): fetch_list=list(self.test_outputs.values())) pred = result[0] pred = np.squeeze(pred).astype('uint8') + logit = result[1] + logit = np.squeeze(logit) + logit = np.transpose(logit, (1, 2, 0)) for info in im_info[::-1]: if info[0] == 'resize': w, h = info[1][1], info[1][0] pred = cv2.resize(pred, (w, h), cv2.INTER_NEAREST) + logit = cv2.resize(logit, (w, h), cv2.INTER_LINEAR) elif info[0] == 'padding': w, h = info[1][1], info[1][0] pred = pred[0:h, 0:w] + logit = logit[0:h, 0:w, :] else: raise Exception("Unexpected info '{}' in im_info".format( info[0])) - return {'label_map': pred, 'score_map': result[1]} + return {'label_map': pred, 'score_map': logit}