Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,12 @@ import gradio as gr
|
|
| 6 |
import torch
|
| 7 |
import easyocr
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
torch.hub.download_url_to_file('https://github.com/JaidedAI/EasyOCR/raw/master/examples/chinese.jpg', 'chinese.jpg')
|
| 11 |
torch.hub.download_url_to_file('https://github.com/JaidedAI/EasyOCR/raw/master/examples/japanese.jpg', 'japanese.jpg')
|
| 12 |
torch.hub.download_url_to_file('https://i.imgur.com/mwQFd7G.jpeg', 'Hindi.jpeg')
|
|
@@ -29,7 +34,9 @@ def inference(img, lang):
|
|
| 29 |
title = '🖼️Image to Multilingual OCR👁️Gradio'
|
| 30 |
description = 'Multilingual OCR which works conveniently on all devices in multiple languages.'
|
| 31 |
article = "<p style='text-align: center'></p>"
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
|
| 34 |
choices = [
|
| 35 |
"ch_sim",
|
|
|
|
| 6 |
import torch
|
| 7 |
import easyocr
|
| 8 |
|
| 9 |
+
|
| 10 |
+
torch.hub.download_url_to_file('https://github.com/AaronCWacker/Yggdrasil/blob/main/images/BeautyIsTruthTruthisBeauty.JPG', 'BeautyIsTruthTruthisBeauty.JPG')
|
| 11 |
+
torch.hub.download_url_to_file('https://github.com/AaronCWacker/Yggdrasil/blob/main/images/PleaseRepeatLouder.jpg', 'PleaseRepeatLouder.jpg')
|
| 12 |
+
torch.hub.download_url_to_file('https://github.com/AaronCWacker/Yggdrasil/blob/main/images/ProhibitedInWhiteHouse.JPG', 'ProhibitedInWhiteHouse.JPG')
|
| 13 |
+
|
| 14 |
+
torch.hub.download_url_to_file('https://github.com/JaidedAI/EasyOCR/raw/master/examples/english.png', 'COVID.png')
|
| 15 |
torch.hub.download_url_to_file('https://github.com/JaidedAI/EasyOCR/raw/master/examples/chinese.jpg', 'chinese.jpg')
|
| 16 |
torch.hub.download_url_to_file('https://github.com/JaidedAI/EasyOCR/raw/master/examples/japanese.jpg', 'japanese.jpg')
|
| 17 |
torch.hub.download_url_to_file('https://i.imgur.com/mwQFd7G.jpeg', 'Hindi.jpeg')
|
|
|
|
| 34 |
title = '🖼️Image to Multilingual OCR👁️Gradio'
|
| 35 |
description = 'Multilingual OCR which works conveniently on all devices in multiple languages.'
|
| 36 |
article = "<p style='text-align: center'></p>"
|
| 37 |
+
|
| 38 |
+
examples = [['PleaseRepeatLouder.jpg',['ja']],['ProhibitedInWhiteHouse.JPG',['en']],['BeautyIsTruthTruthisBeauty.JPG',['en']],['COVID.png',['en']],['chinese.jpg',['ch_sim', 'en']],['japanese.jpg',['ja', 'en']],['Hindi.jpeg',['hi', 'en']]]
|
| 39 |
+
|
| 40 |
css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
|
| 41 |
choices = [
|
| 42 |
"ch_sim",
|