Tonic commited on
Commit
4c630fe
·
unverified ·
1 Parent(s): 4326b14

improve gradio display

Browse files
Files changed (1) hide show
  1. app.py +46 -37
app.py CHANGED
@@ -115,45 +115,54 @@ def cleanup_old_files():
115
  file_path.unlink()
116
 
117
  with gr.Blocks() as demo:
118
- gr.Markdown(title)
119
- gr.Markdown(description)
120
- gr.Markdown(joinus)
121
 
122
- with gr.Column():
123
- image_input = gr.Image(type="filepath", label="Input Image")
124
- task_dropdown = gr.Dropdown(
125
- choices=[
126
- "Plain Text OCR",
127
- "Format Text OCR",
128
- "Fine-grained OCR (Box)",
129
- "Fine-grained OCR (Color)",
130
- "Multi-crop OCR",
131
- "Render Formatted OCR"
132
- ],
133
- label="Select Task",
134
- value="Plain Text OCR"
135
- )
136
- ocr_type_dropdown = gr.Dropdown(
137
- choices=["ocr", "format"],
138
- label="OCR Type",
139
- visible=False
140
- )
141
- ocr_box_input = gr.Textbox(
142
- label="OCR Box (x1,y1,x2,y2)",
143
- placeholder="[100,100,200,200]",
144
- visible=False
145
- )
146
- ocr_color_dropdown = gr.Dropdown(
147
- choices=["red", "green", "blue"],
148
- label="OCR Color",
149
- visible=False
150
- )
151
- submit_button = gr.Button("Process")
152
-
153
- output_markdown = gr.Markdown(label="🫴🏻📸GOT-OCR")
154
- output_html = gr.HTML(label="🫴🏻📸GOT-OCR")
 
 
 
 
 
 
 
155
 
156
- gr.Markdown(modelinfor)
 
 
 
157
 
158
  task_dropdown.change(
159
  update_inputs,
 
115
  file_path.unlink()
116
 
117
  with gr.Blocks() as demo:
118
+ with gr.Row():
119
+ gr.Markdown(title)
 
120
 
121
+ with gr.Row():
122
+ with gr.Column(scale=1):
123
+ gr.Markdown(description)
124
+ with gr.Column(scale=1):
125
+ with gr.Group():
126
+ gr.Markdown(modelinfor)
127
+ gr.Markdown(joinus)
128
+
129
+ with gr.Row():
130
+ with gr.Column(scale=1):
131
+ with gr.Group():
132
+ image_input = gr.Image(type="filepath", label="Input Image")
133
+ task_dropdown = gr.Dropdown(
134
+ choices=[
135
+ "Plain Text OCR",
136
+ "Format Text OCR",
137
+ "Fine-grained OCR (Box)",
138
+ "Fine-grained OCR (Color)",
139
+ "Multi-crop OCR",
140
+ "Render Formatted OCR"
141
+ ],
142
+ label="Select Task",
143
+ value="Plain Text OCR"
144
+ )
145
+ ocr_type_dropdown = gr.Dropdown(
146
+ choices=["ocr", "format"],
147
+ label="OCR Type",
148
+ visible=False
149
+ )
150
+ ocr_box_input = gr.Textbox(
151
+ label="OCR Box (x1,y1,x2,y2)",
152
+ placeholder="[100,100,200,200]",
153
+ visible=False
154
+ )
155
+ ocr_color_dropdown = gr.Dropdown(
156
+ choices=["red", "green", "blue"],
157
+ label="OCR Color",
158
+ visible=False
159
+ )
160
+ submit_button = gr.Button("Process")
161
 
162
+ with gr.Column(scale=1):
163
+ with gr.Group():
164
+ output_markdown = gr.Markdown(label="🫴🏻📸GOT-OCR")
165
+ output_html = gr.HTML(label="🫴🏻📸GOT-OCR")
166
 
167
  task_dropdown.change(
168
  update_inputs,