kevinconka commited on
Commit
8e60091
·
1 Parent(s): e921d65

added queue + minor wording fixes

Browse files
Files changed (1) hide show
  1. app.py +20 -16
app.py CHANGED
@@ -2,22 +2,32 @@ import gradio as gr
2
  from utils import load_model, load_image_from_url, inference
3
 
4
 
5
- TITLE = """
6
  <p align="right">
7
  <img alt="Static Badge" src="https://img.shields.io/badge/SEA.AI-beta-blue">
8
  </p>
9
- <div align="center">
10
- <h1>RGB Detection Demo</h1>
11
- Give it a try! Upload an image or enter a URL to an image and click submit.
12
- </div>
 
 
 
 
13
  """
14
 
15
  NOTICE = """
16
- Don't like what you see? Help us improve the model by flagging
17
- incorrect predictions. Click on `Flag` to submit the image to
18
- us for review and we'll use it to improve the A.I.
19
  """
20
 
 
 
 
 
 
 
21
 
22
  model = load_model("SEA-AI/yolov5n6-RGB", img_size=1280)
23
  model.conf = 0.25
@@ -28,14 +38,8 @@ model.agnostic = True # NMS class-agnostic
28
  # This callback will be used to flag images
29
  callback = gr.CSVLogger()
30
 
31
- css = """
32
- h1 {
33
- text-align: center;
34
- display: block;
35
- }
36
- """
37
-
38
  with gr.Blocks(css=css) as demo:
 
39
  gr.Markdown(value=TITLE)
40
 
41
  with gr.Row():
@@ -96,4 +100,4 @@ with gr.Blocks(css=css) as demo:
96
  ).then(lambda: gr.Info("Thank you for contributing!"))
97
 
98
 
99
- demo.launch()
 
2
  from utils import load_model, load_image_from_url, inference
3
 
4
 
5
+ BADGES = """
6
  <p align="right">
7
  <img alt="Static Badge" src="https://img.shields.io/badge/SEA.AI-beta-blue">
8
  </p>
9
+ """
10
+
11
+ TITLE = """
12
+ <h1> RGB Detection Demo </h1>
13
+ <p align="center">
14
+ Give it a try! Upload an image or enter a URL to an image and click
15
+ <code>Submit</code>.
16
+ </p>
17
  """
18
 
19
  NOTICE = """
20
+ See something off? Your feedback makes a difference! Let us know by
21
+ flagging any outcomes that don't seem right. Just click on `Flag`
22
+ to submit the image for review.
23
  """
24
 
25
+ css = """
26
+ h1 {
27
+ text-align: center;
28
+ display: block;
29
+ }
30
+ """
31
 
32
  model = load_model("SEA-AI/yolov5n6-RGB", img_size=1280)
33
  model.conf = 0.25
 
38
  # This callback will be used to flag images
39
  callback = gr.CSVLogger()
40
 
 
 
 
 
 
 
 
41
  with gr.Blocks(css=css) as demo:
42
+ gr.Markdown(value=BADGES)
43
  gr.Markdown(value=TITLE)
44
 
45
  with gr.Row():
 
100
  ).then(lambda: gr.Info("Thank you for contributing!"))
101
 
102
 
103
+ demo.queue().launch()