Spaces:
Sleeping
Sleeping
RufusRubin777
commited on
Update app_1.py
Browse files
app_1.py
CHANGED
@@ -29,7 +29,7 @@ def image_to_base64(image):
|
|
29 |
image.save(buffered, format="PNG")
|
30 |
return base64.b64encode(buffered.getvalue()).decode()
|
31 |
|
32 |
-
|
33 |
# @spaces.GPU
|
34 |
def run_GOT(image,language):
|
35 |
unique_id = str(uuid.uuid4())
|
@@ -93,7 +93,20 @@ title_html = """
|
|
93 |
<p>Scan Master uses General OCR Theory (GOT), a 580M end-to-end OCR 2.0 model for English optical character recognition and EASYOCR for Hindi optical character recognition. It supports plain text ocr.</p>
|
94 |
"""
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
|
|
97 |
with gr.Blocks() as scan_master_web_app:
|
98 |
gr.HTML(title_html)
|
99 |
gr.Markdown("""
|
@@ -125,8 +138,8 @@ with gr.Blocks() as scan_master_web_app:
|
|
125 |
with gr.Column():
|
126 |
search_result = gr.HTML(label="Search result")
|
127 |
|
128 |
-
gr.HTML(acknowledgement_html)
|
129 |
-
gr.HTML(aboutme_html)
|
130 |
|
131 |
submit_button.click(
|
132 |
run_GOT,
|
@@ -142,4 +155,4 @@ with gr.Blocks() as scan_master_web_app:
|
|
142 |
|
143 |
if __name__ == "__main__":
|
144 |
cleanup_old_files()
|
145 |
-
scan_master_web_app.launch()
|
|
|
29 |
image.save(buffered, format="PNG")
|
30 |
return base64.b64encode(buffered.getvalue()).decode()
|
31 |
|
32 |
+
# OCR Processing of the image uploaded by the user
|
33 |
# @spaces.GPU
|
34 |
def run_GOT(image,language):
|
35 |
unique_id = str(uuid.uuid4())
|
|
|
93 |
<p>Scan Master uses General OCR Theory (GOT), a 580M end-to-end OCR 2.0 model for English optical character recognition and EASYOCR for Hindi optical character recognition. It supports plain text ocr.</p>
|
94 |
"""
|
95 |
|
96 |
+
# acknowledgement_html = """
|
97 |
+
# <h3>Acknowledgement</h3>
|
98 |
+
# <a href="https://huggingface.co/ucaslcl/GOT-OCR2_0">[π Hugging Face]</a>
|
99 |
+
# <a href="https://arxiv.org/abs/2409.01704">[π Paper]</a>
|
100 |
+
# <a href="https://github.com/Ucas-HaoranWei/GOT-OCR2.0/">[π GitHub]</a>
|
101 |
+
# """
|
102 |
+
|
103 |
+
# aboutme_html = """
|
104 |
+
# <h3>About Me</h3>
|
105 |
+
# <p>Name : Satvik Chandrakar</p>
|
106 |
+
# <a href="https://github.com/Satvik-ai">[π GitHub]</a> """
|
107 |
+
|
108 |
|
109 |
+
# Scan Master web application developed using Gradio
|
110 |
with gr.Blocks() as scan_master_web_app:
|
111 |
gr.HTML(title_html)
|
112 |
gr.Markdown("""
|
|
|
138 |
with gr.Column():
|
139 |
search_result = gr.HTML(label="Search result")
|
140 |
|
141 |
+
# gr.HTML(acknowledgement_html)
|
142 |
+
# gr.HTML(aboutme_html)
|
143 |
|
144 |
submit_button.click(
|
145 |
run_GOT,
|
|
|
155 |
|
156 |
if __name__ == "__main__":
|
157 |
cleanup_old_files()
|
158 |
+
scan_master_web_app.launch()
|