rrighart commited on
Commit
32b4350
1 Parent(s): 7f9c76e
Files changed (1) hide show
  1. app.py +19 -3
app.py CHANGED
@@ -18,18 +18,34 @@ def yolov7_inference(
18
 
19
 
20
  inputs = [
21
- gr.inputs.Image(type="pil", label="Input Image"),
22
  gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.50, step=0.05, label="Confidence Threshold"),
23
  ]
24
 
 
 
 
 
 
 
 
25
  demo_app = gr.Interface(
26
  fn=yolov7_inference,
27
  inputs=inputs,
28
- outputs=gr.outputs.Image(type="filepath", label="Output Image"),
29
  title="Detection of jar lid defects (Yolov7)",
30
- description = "App detecting jar lids that are damaged versus intact. Type of damage is deformation, hole or scratch | Ruthger Righart ",
 
 
 
 
 
 
 
 
31
  article = "<p style='text-align: center'><a href='https://www.rrighart.com' target='_blank'>Webpage</a></p> <p style='text-align: center'><a href='https://www.kaggle.com/code/rrighart/detection-of-product-defects-using-yolov7' target='_blank'>Kaggle</a></p>",
32
  examples=[['example1.JPG', 0.50], ['example2.JPG', 0.50], ['example3.JPG', 0.50]],
 
33
  cache_examples=True,
34
  )
35
  demo_app.launch(debug=False, enable_queue=True)
18
 
19
 
20
  inputs = [
21
+ gr.inputs.Image(shape=(640, 480), type="pil", label="Input Image"),
22
  gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.50, step=0.05, label="Confidence Threshold"),
23
  ]
24
 
25
+ outputs = [
26
+ gr.outputs.Image(type="filepath").style(height=400, width=400),
27
+
28
+ ]
29
+
30
+ css = ".output_image {height: 40rem !important; width: 100% !important;}"
31
+
32
  demo_app = gr.Interface(
33
  fn=yolov7_inference,
34
  inputs=inputs,
35
+ outputs=outputs,
36
  title="Detection of jar lid defects (Yolov7)",
37
+ description = """
38
+ This application is detecting damaged jar lids. Type of damages include deformations, holes or scratches. The object detection notebook can be found at <a href="https://www.kaggle.com/rrighart">Kaggle</a>
39
+
40
+ Contact: Ruthger Righart
41
+
42
+ Email: rrighart@googlemail.com
43
+
44
+ Web: <a href="https://www.rrighart.com">www.rrighart.com</a>
45
+ """,
46
  article = "<p style='text-align: center'><a href='https://www.rrighart.com' target='_blank'>Webpage</a></p> <p style='text-align: center'><a href='https://www.kaggle.com/code/rrighart/detection-of-product-defects-using-yolov7' target='_blank'>Kaggle</a></p>",
47
  examples=[['example1.JPG', 0.50], ['example2.JPG', 0.50], ['example3.JPG', 0.50]],
48
+ css=css,
49
  cache_examples=True,
50
  )
51
  demo_app.launch(debug=False, enable_queue=True)