Skip to content

Commit

Permalink
修复20240808更新BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
KIYI671 committed Aug 9, 2024
1 parent fc4c802 commit 07afdaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion my_ocr/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ def commom_gain_text(pic_byte_stream, language="models/config_en.txt"):
def find_and_click_text(word):
leave = commom_gain_text(commom_all_ocr()[0])
p = []
if "No text found in image." in leave:
return None
for b in leave:
if word in b['text'].lower():
box = b['box']
Expand All @@ -408,4 +410,4 @@ def find_and_click_text(word):
else:
msg = f"OCR没有检测到单词{word}"
my_log("debug", msg)
return p
return p

0 comments on commit 07afdaf

Please sign in to comment.