Spaces:
Running
Running
Zengyf-CVer
commited on
Commit
β’
e59da9c
1
Parent(s):
c6d26b8
readme update
Browse files
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
title: OCR Translate
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.0.26
|
8 |
app_file: app.py
|
@@ -11,3 +11,4 @@ license: gpl-3.0
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
1 |
---
|
2 |
title: OCR Translate
|
3 |
+
emoji: π
|
4 |
+
colorFrom: red
|
5 |
+
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.0.26
|
8 |
app_file: app.py
|
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
14 |
+
Project address: https://gitee.com/CV_Lab/ocr-translate
|
app.py
CHANGED
@@ -114,7 +114,7 @@ def main():
|
|
114 |
with gr.Box():
|
115 |
|
116 |
with gr.Row():
|
117 |
-
gr.Markdown("### Step 01: Text
|
118 |
|
119 |
with gr.Row():
|
120 |
with gr.Column():
|
@@ -128,7 +128,7 @@ def main():
|
|
128 |
|
129 |
with gr.Row():
|
130 |
clear_img_btn = gr.Button('Clear')
|
131 |
-
ocr_btn = gr.Button(value='OCR
|
132 |
|
133 |
with gr.Column():
|
134 |
with gr.Row():
|
@@ -140,7 +140,7 @@ def main():
|
|
140 |
label='translation mode')
|
141 |
with gr.Row():
|
142 |
clear_text_btn = gr.Button('Clear')
|
143 |
-
translate_btn = gr.Button(value='
|
144 |
|
145 |
with gr.Row():
|
146 |
example_list = [["./data/test.png", ["eng"]], ["./data/test02.png", ["eng"]],
|
@@ -154,11 +154,11 @@ def main():
|
|
154 |
gr.Markdown("### Step 02: Translation")
|
155 |
|
156 |
with gr.Row():
|
157 |
-
outputs_tr_text = gr.Textbox(label="
|
158 |
|
159 |
with gr.Row():
|
160 |
-
cp_clear_btn = gr.Button(value='
|
161 |
-
cp_btn = gr.Button(value='
|
162 |
|
163 |
# ---------------------- OCR Tesseract ----------------------
|
164 |
ocr_btn.click(fn=ocr_tesseract, inputs=[inputs_img, inputs_lang], outputs=[
|
|
|
114 |
with gr.Box():
|
115 |
|
116 |
with gr.Row():
|
117 |
+
gr.Markdown("### Step 01: Text Extraction")
|
118 |
|
119 |
with gr.Row():
|
120 |
with gr.Column():
|
|
|
128 |
|
129 |
with gr.Row():
|
130 |
clear_img_btn = gr.Button('Clear')
|
131 |
+
ocr_btn = gr.Button(value='OCR Extraction', variant="primary")
|
132 |
|
133 |
with gr.Column():
|
134 |
with gr.Row():
|
|
|
140 |
label='translation mode')
|
141 |
with gr.Row():
|
142 |
clear_text_btn = gr.Button('Clear')
|
143 |
+
translate_btn = gr.Button(value='Translate', variant="primary")
|
144 |
|
145 |
with gr.Row():
|
146 |
example_list = [["./data/test.png", ["eng"]], ["./data/test02.png", ["eng"]],
|
|
|
154 |
gr.Markdown("### Step 02: Translation")
|
155 |
|
156 |
with gr.Row():
|
157 |
+
outputs_tr_text = gr.Textbox(label="Translate Content", lines=20)
|
158 |
|
159 |
with gr.Row():
|
160 |
+
cp_clear_btn = gr.Button(value='Clear Clipboard')
|
161 |
+
cp_btn = gr.Button(value='Copy to clipboard', variant="primary")
|
162 |
|
163 |
# ---------------------- OCR Tesseract ----------------------
|
164 |
ocr_btn.click(fn=ocr_tesseract, inputs=[inputs_img, inputs_lang], outputs=[
|