Skip to content

Commit

Permalink
update allowlist
Browse files Browse the repository at this point in the history
  • Loading branch information
vvng7190 committed Dec 4, 2023
1 parent cdd36e4 commit d178f93
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Signboard_detect&ocr&translate&gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def load_images():
listbox_images.insert(tk.END, os.path.join(image_folder_path, image))

def detect_text(image_path):
results = model(image_path)
results = model(image_path,
conf=0.8)
boxes = results[0].boxes.xyxy
annotated = results[0].plot()
image = cv2.imread(image_path)
Expand All @@ -44,7 +45,8 @@ def detect_text(image_path):
ocr_results = reader.readtext(cropped_image,
allowlist = '{소망동물병원삼화페인트\
서부슈퍼지영선한복맛깔명성안경콘택트\
공덕커피애월식당새진테크')
공덕커피애월식당새진테크\
뉴욕야시장삼청당주안피아노후문약국치즈를사랑한찜닭다비치안경')
for detection in ocr_results:
detected_texts = detection[1].replace(' ', '')

Expand Down Expand Up @@ -189,7 +191,7 @@ def open_link_in_webview(url):
submit_button.pack()

# right_frame
combined_scrolled_text = scrolledtext.ScrolledText(right_frame, height=20, width=40)
combined_scrolled_text = scrolledtext.ScrolledText(right_frame, width=40, height=20)
combined_scrolled_text.pack()

button_ocr_translate = tk.Button(right_frame, text="Translate Text", command=display_results)
Expand Down

0 comments on commit d178f93

Please sign in to comment.