Skip to content

Commit aef495c

Browse files
authored
[Fix] Update image decoding and processing in Worker class (#193)
1 parent 624da4f commit aef495c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

PPOCRLabel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def get_str(str_id):
194194
params = {
195195
"use_doc_orientation_classify": False,
196196
"use_doc_unwarping": False,
197-
"use_textline_orientation": True,
197+
"use_textline_orientation": False,
198198
"device": self.gpu,
199199
"lang": self.lang,
200200
"text_detection_model_name": "PP-OCRv5_server_det",

libs/autoDialog.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ def run(self):
4141
if self.handle == 0:
4242
self.listValue.emit(img_path)
4343
if self.model == "paddle":
44-
h, w, _ = cv2.imdecode(
44+
img = cv2.imdecode(
4545
np.fromfile(img_path, dtype=np.uint8), cv2.IMREAD_COLOR
46-
).shape
46+
)
47+
h, w, _ = img.shape
4748
if h > 32 and w > 32:
48-
result = self.ocr.predict(img_path)[0]
49+
result = self.ocr.predict(img)[0]
4950
self.result_dic = []
5051
for poly, text, score in zip(
5152
result["rec_polys"],

0 commit comments

Comments
 (0)