Skip to content

Commit

Permalink
start working image translator
Browse files Browse the repository at this point in the history
  • Loading branch information
PhoenixSys committed Mar 5, 2022
1 parent 3163ed2 commit 142a7fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion image_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
Image.open(f'AgACAgQAAxkBAAOzYiONHyOprDwpfmj0Jvblf0s62y8AAm23MRtnxhhRnCgyYLkPXPYBAAMCAAN5AAMjBA.jpg'))
print(result)

translation = Translator().translate("hello", dest="fa")
translation = Translator().translate(result, dest="fa")
print(translation.text)
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def contact(message):
img = Image.open(f'{fileID}.jpg')
result = pytesseract.image_to_string(img)
print(result)
translation = Translator().translate("hello", dest="fa")
translation = Translator().translate(result, dest="fa")
print(translation.text)
bot.send_message(message.chat.id, translation.text)

Expand Down

0 comments on commit 142a7fe

Please sign in to comment.