Kawthar12h
commited on
Commit
•
6b49c3e
1
Parent(s):
3e20073
Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ img_cap_en_ar = gr.Interface(
|
|
56 |
gr.HTML(label='Arabic Caption')],
|
57 |
title='Image Captioning | وصف الصورة',
|
58 |
description="Upload an image to generate an English & Arabic caption | قم برفع صورة وأرسلها ليظهر لك وصف للصورة",
|
59 |
-
examples =[["
|
60 |
)
|
61 |
|
62 |
|
@@ -90,7 +90,7 @@ text_recognition = gr.Interface(
|
|
90 |
outputs=[gr.Textbox(label='Extracted text'), gr.HTML(label= 'Translateted of Extracted text ')], # Output is text
|
91 |
title="Text Extraction and Translation | إستخراج النص وترجمتة",
|
92 |
description="Upload an image then Submet to extract text and translate it to Arabic| قم برفع الصورة وأرسلها ليظهر لك النص من الصورة",
|
93 |
-
examples =[["tx_image_0.png"]
|
94 |
)
|
95 |
|
96 |
# Load trocr model for handwritten text extraction
|
@@ -122,9 +122,11 @@ handwritten_rec = gr.Interface(
|
|
122 |
gr.HTML(label='Arabic Text')],
|
123 |
title="Handwritten Text Extraction | | إستخراج النص المكتوب بخط اليد وترجمتة",
|
124 |
description="Upload an image then Submet to extract text and translate it to Arabic| قم برفع الصورة وأرسلها ليظهر لك النص من الصورة",
|
125 |
-
examples =[["tx_image_1.png"]
|
126 |
)
|
127 |
|
128 |
# Combine all interfaces into a tabbed interface
|
129 |
demo = gr.TabbedInterface([img_cap_en_ar, text_recognition, handwritten_rec], ["Extract_Caption", " Extract_Digital_text", " Extract_HandWritten_text"])
|
130 |
-
demo.launch(debug=True
|
|
|
|
|
|
56 |
gr.HTML(label='Arabic Caption')],
|
57 |
title='Image Captioning | وصف الصورة',
|
58 |
description="Upload an image to generate an English & Arabic caption | قم برفع صورة وأرسلها ليظهر لك وصف للصورة",
|
59 |
+
examples =[["image_2.png"]]
|
60 |
)
|
61 |
|
62 |
|
|
|
90 |
outputs=[gr.Textbox(label='Extracted text'), gr.HTML(label= 'Translateted of Extracted text ')], # Output is text
|
91 |
title="Text Extraction and Translation | إستخراج النص وترجمتة",
|
92 |
description="Upload an image then Submet to extract text and translate it to Arabic| قم برفع الصورة وأرسلها ليظهر لك النص من الصورة",
|
93 |
+
examples =[["tx_image_0.png"]],
|
94 |
)
|
95 |
|
96 |
# Load trocr model for handwritten text extraction
|
|
|
122 |
gr.HTML(label='Arabic Text')],
|
123 |
title="Handwritten Text Extraction | | إستخراج النص المكتوب بخط اليد وترجمتة",
|
124 |
description="Upload an image then Submet to extract text and translate it to Arabic| قم برفع الصورة وأرسلها ليظهر لك النص من الصورة",
|
125 |
+
examples =[["tx_image_1.png"]]
|
126 |
)
|
127 |
|
128 |
# Combine all interfaces into a tabbed interface
|
129 |
demo = gr.TabbedInterface([img_cap_en_ar, text_recognition, handwritten_rec], ["Extract_Caption", " Extract_Digital_text", " Extract_HandWritten_text"])
|
130 |
+
demo.launch(debug=True)
|
131 |
+
if __name__ == "__main__":
|
132 |
+
app.run(host= "0.0.0.0", port=7860)
|