Martin Tomov commited on
Commit
8f8b4f5
1 Parent(s): f8f392e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -6
app.py CHANGED
@@ -224,13 +224,38 @@ examples = [
224
  ["flower-night.jpg"]
225
  ]
226
 
227
- with gr.Blocks() as demo:
228
- gr.Markdown("# InsectSAM: Detect and Segment Insects in Images - ARISE, DIOPSIS🐞")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  with gr.Row():
230
  image_input = gr.Image(type="pil")
231
- include_json = gr.Checkbox(label="Include JSON", value=False)
232
- include_bboxes = gr.Checkbox(label="Include Bounding Boxes", value=False)
233
- submit_button = gr.Button("Submit")
 
234
 
235
  annotated_output = gr.Image(type="numpy")
236
  json_output = gr.Textbox()
@@ -255,4 +280,4 @@ with gr.Blocks() as demo:
255
 
256
  gr.Examples(examples=examples, inputs=image_input)
257
 
258
- demo.launch()
 
224
  ["flower-night.jpg"]
225
  ]
226
 
227
+ css = """
228
+ #title {
229
+ text-align: center;
230
+ font-size: 2em;
231
+ margin-bottom: 20px;
232
+ }
233
+ #submit-button {
234
+ background-color: orange !important;
235
+ border: none !important;
236
+ color: white !important;
237
+ font-size: 1em;
238
+ padding: 10px 20px;
239
+ }
240
+ .checkbox-group {
241
+ display: flex;
242
+ justify-content: center;
243
+ gap: 20px;
244
+ margin-bottom: 20px;
245
+ }
246
+ .checkbox-group .gr-checkbox {
247
+ width: auto;
248
+ }
249
+ """
250
+
251
+ with gr.Blocks(css=css) as demo:
252
+ gr.Markdown("<div id='title'>InsectSAM 🐞 Detect and Segment Insects in Images - ARISE, DIOPSIS</div>")
253
  with gr.Row():
254
  image_input = gr.Image(type="pil")
255
+ with gr.Column(elem_id="checkbox-group"):
256
+ include_json = gr.Checkbox(label="Include JSON", value=False)
257
+ include_bboxes = gr.Checkbox(label="Include Bounding Boxes", value=False)
258
+ submit_button = gr.Button("Submit", elem_id="submit-button")
259
 
260
  annotated_output = gr.Image(type="numpy")
261
  json_output = gr.Textbox()
 
280
 
281
  gr.Examples(examples=examples, inputs=image_input)
282
 
283
+ demo.launch()