From cb9d7866d5071b0a8ec28c04313e8bd82b99fda3 Mon Sep 17 00:00:00 2001 From: edencfc <39668828+edencfc@users.noreply.github.com> Date: Mon, 25 Jul 2022 11:35:05 +0800 Subject: [PATCH 1/2] Fixed Chinese path not recognize bug Fixed the bug where Chinese path pictures were not recognized --- PPOCRLabel/PPOCRLabel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index 440c2d8c3..f439efd8e 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -2115,7 +2115,7 @@ class MainWindow(QMainWindow): self.init_key_list(self.Cachelabel) def reRecognition(self): - img = cv2.imread(self.filePath) + img = cv2.imdecode(np.fromfile(self.filePath,dtype=np.uint8),-1) # org_box = [dic['points'] for dic in self.PPlabel[self.getImglabelidx(self.filePath)]] if self.canvas.shapes: self.result_dic = [] @@ -2184,7 +2184,7 @@ class MainWindow(QMainWindow): QMessageBox.information(self, "Information", "Draw a box!") def singleRerecognition(self): - img = cv2.imread(self.filePath) + img = cv2.imdecode(np.fromfile(self.filePath,dtype=np.uint8),-1) for shape in self.canvas.selectedShapes: box = [[int(p.x()), int(p.y())] for p in shape.points] if len(box) > 4: From 60a2dcdfb6a0da084296adfe7ee47d79b3ca8162 Mon Sep 17 00:00:00 2001 From: edencfc <39668828+edencfc@users.noreply.github.com> Date: Tue, 26 Jul 2022 15:42:52 +0800 Subject: [PATCH 2/2] Update PPOCRLabel.py --- PPOCRLabel/PPOCRLabel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PPOCRLabel/PPOCRLabel.py b/PPOCRLabel/PPOCRLabel.py index f439efd8e..aeed6435a 100644 --- a/PPOCRLabel/PPOCRLabel.py +++ b/PPOCRLabel/PPOCRLabel.py @@ -2115,7 +2115,7 @@ class MainWindow(QMainWindow): self.init_key_list(self.Cachelabel) def reRecognition(self): - img = cv2.imdecode(np.fromfile(self.filePath,dtype=np.uint8),-1) + img = cv2.imdecode(np.fromfile(self.filePath,dtype=np.uint8),1) # org_box = [dic['points'] for dic in self.PPlabel[self.getImglabelidx(self.filePath)]] if self.canvas.shapes: self.result_dic = [] @@ -2184,7 +2184,7 @@ class MainWindow(QMainWindow): QMessageBox.information(self, "Information", "Draw a box!") def singleRerecognition(self): - img = cv2.imdecode(np.fromfile(self.filePath,dtype=np.uint8),-1) + img = cv2.imdecode(np.fromfile(self.filePath,dtype=np.uint8),1) for shape in self.canvas.selectedShapes: box = [[int(p.x()), int(p.y())] for p in shape.points] if len(box) > 4: