MohamedRashad commited on
Commit
d40f9a3
·
1 Parent(s): fc3376f

Enhance Gradio interface by replacing markdown with a styled HTML header that includes links to resources.

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -56,14 +56,26 @@ def ocr_image_gradio(image, max_tokens=4096):
56
  return f"Error processing image: {str(e)}"
57
 
58
  # Create Gradio interface
59
- with gr.Blocks(title="Nanonets OCR Demo", theme=gr.themes.Soft()) as demo:
60
- # Replace simple markdown with styled HTML header
61
  gr.HTML("""
62
  <div class="title" style="text-align: center">
63
  <h1>🔍 Nanonets OCR - Document Text Extraction</h1>
64
  <p style="font-size: 1.1em; color: #6b7280; margin-bottom: 0.6em;">
65
  A state-of-the-art image-to-markdown OCR model for intelligent document processing
66
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
67
  </div>
68
  """)
69
 
@@ -136,18 +148,6 @@ with gr.Blocks(title="Nanonets OCR Demo", theme=gr.themes.Soft()) as demo:
136
  - **Complex Table Extraction**: Accurately extracts complex tables from documents and converts them into both markdown
137
  and HTML table formats.
138
  """)
139
-
140
- # Add links section at the bottom
141
- gr.Markdown("""
142
- ---
143
- ### Resources
144
-
145
- - [📚 Hugging Face Model](https://huggingface.co/nanonets/Nanonets-OCR-s)
146
- - [📝 Release Blog](https://nanonets.com/research/nanonets-ocr-s/)
147
- - [💻 GitHub Repository](https://github.com/NanoNets/docext)
148
-
149
- ---
150
- """)
151
 
152
  if __name__ == "__main__":
153
  demo.queue().launch()
 
56
  return f"Error processing image: {str(e)}"
57
 
58
  # Create Gradio interface
59
+ with gr.Blocks(title="Nanonets OCR Demo") as demo:
60
+ # Replace simple markdown with styled HTML header that includes resources
61
  gr.HTML("""
62
  <div class="title" style="text-align: center">
63
  <h1>🔍 Nanonets OCR - Document Text Extraction</h1>
64
  <p style="font-size: 1.1em; color: #6b7280; margin-bottom: 0.6em;">
65
  A state-of-the-art image-to-markdown OCR model for intelligent document processing
66
  </p>
67
+ <div style="display: flex; justify-content: center; gap: 20px; margin: 15px 0;">
68
+ <a href="https://huggingface.co/nanonets/Nanonets-OCR-s" target="_blank" style="text-decoration: none; color: #2563eb; font-weight: 500;">
69
+ 📚 Hugging Face Model
70
+ </a>
71
+ <a href="https://nanonets.com/research/nanonets-ocr-s/" target="_blank" style="text-decoration: none; color: #2563eb; font-weight: 500;">
72
+ 📝 Release Blog
73
+ </a>
74
+ <a href="https://github.com/NanoNets/docext" target="_blank" style="text-decoration: none; color: #2563eb; font-weight: 500;">
75
+ 💻 GitHub Repository
76
+ </a>
77
+ </div>
78
+ <hr style="width: 70%; margin: 15px auto; border: none; height: 1px; background-color: #e5e7eb;">
79
  </div>
80
  """)
81
 
 
148
  - **Complex Table Extraction**: Accurately extracts complex tables from documents and converts them into both markdown
149
  and HTML table formats.
150
  """)
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  if __name__ == "__main__":
153
  demo.queue().launch()