stshanks commited on
Commit
57a2a31
·
verified ·
1 Parent(s): 691912b

Update app.py

Browse files

update to gradio theme

Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -61,12 +61,25 @@ def predict_text(image):
61
 
62
 
63
  # Gradio UI
64
- with gr.Blocks(theme=gr.themes.Glass()) as interface:
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  # Header
67
  gr.Markdown(
68
  """
69
- <h1 style="text-align: center; background-color: #002855; color: #e2cb92;">🏥 Prescription Recognition AI</h1>
70
  <p style="text-align: center; font-size: 18px;">Upload or take a picture of a handwritten prescription. The AI will identify the drug name.</p>
71
  <hr>
72
  """,
@@ -90,5 +103,6 @@ with gr.Blocks(theme=gr.themes.Glass()) as interface:
90
  submit_button.click(fn=predict_text, inputs=image_input, outputs=output_text)
91
 
92
 
 
93
  if __name__ == "__main__":
94
  interface.launch()
 
61
 
62
 
63
  # Gradio UI
64
+ # Load custom CSS from an external file
65
+ with open("styles.css", "r") as f:
66
+ custom_css = f.read()
67
+
68
+ # Create a custom Gradio theme using the external CSS
69
+ custom_theme = gr.themes.Base(
70
+ font=["Arial", "sans-serif"],
71
+ primary_hue="#e2cb92", # GWU official gold as primary color
72
+ background_fill_color="#002855", # GWU official blue as background color
73
+ css=custom_css
74
+ )
75
+
76
+ # Gradio UI
77
+ with gr.Blocks(theme=custom_theme) as interface:
78
 
79
  # Header
80
  gr.Markdown(
81
  """
82
+ <h1 style="text-align: center;">🏥 Prescription Recognition AI</h1>
83
  <p style="text-align: center; font-size: 18px;">Upload or take a picture of a handwritten prescription. The AI will identify the drug name.</p>
84
  <hr>
85
  """,
 
103
  submit_button.click(fn=predict_text, inputs=image_input, outputs=output_text)
104
 
105
 
106
+
107
  if __name__ == "__main__":
108
  interface.launch()