From b541cc12be890212adcd20d5cd99b5767c7fb0f0 Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Mon, 4 Jul 2022 04:26:54 +0000 Subject: [PATCH] fix shape unmatch error --- ppocr/postprocess/pse_postprocess/pse_postprocess.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ppocr/postprocess/pse_postprocess/pse_postprocess.py b/ppocr/postprocess/pse_postprocess/pse_postprocess.py index 34f1b8c9..962f3efe 100755 --- a/ppocr/postprocess/pse_postprocess/pse_postprocess.py +++ b/ppocr/postprocess/pse_postprocess/pse_postprocess.py @@ -58,6 +58,8 @@ class PSEPostProcess(object): kernels = (pred > self.thresh).astype('float32') text_mask = kernels[:, 0, :, :] + text_mask = paddle.unsqueeze(text_mask, axis=1) + kernels[:, 0:, :, :] = kernels[:, 0:, :, :] * text_mask score = score.numpy() -- GitLab