mkthoma commited on
Commit
c9f38d5
·
1 Parent(s): 03588a4

app update

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -71,22 +71,23 @@ title = "Custom YOLOv3"
71
  description = "Pytorch Lightning implemetation of YOLOv3 on Pascal VOC dataset.\
72
  Supported classes are aeroplane, bicycle, bird, boat, bottle, bus, car, cat, chair, cow, dining table, dog, horse, motorbike, person, potted plant, sheep, sofa, train, and TV/monitor."
73
 
74
- # examples = [
75
- # ["images/000014.jpg", 0.5, 0.4, True, 0.5],
76
- # ["images/000017.jpg", 0.6, 0.5, True, 0.5],
77
- # ["images/000018.jpg", 0.55, 0.45, True, 0.5],
78
- # ["images/000030.jpg", 0.5, 0.4, True, 0.5],
79
- # ["images/Puppies.jpg", 0.6, 0.7, True, 0.5],
80
- # ]
 
81
 
82
  demo = gr.Interface(model_inference, inputs=[gr.Image(label="Input an image"),
83
- gr.Slider(0, 1, value=0.5, label="IOU Threshold"),
84
- gr.Slider(0, 1, value=0.4, label="Threshold"),
85
- gr.Radio(["Yes", "No"], value="No" , label="Show GradCAM outputs"),
86
- gr.Slider(0, 1, value=0.5, label="Opacity of GradCAM"),
87
- gr.Slider(-2, -1, value=-1, step=1, label="Which Layer?")],
88
- outputs=[gr.Gallery(label="Model Outputs", rows=2, columns=1)],
89
- title=title, description=description)
90
  demo.launch()
91
 
92
 
 
71
  description = "Pytorch Lightning implemetation of YOLOv3 on Pascal VOC dataset.\
72
  Supported classes are aeroplane, bicycle, bird, boat, bottle, bus, car, cat, chair, cow, dining table, dog, horse, motorbike, person, potted plant, sheep, sofa, train, and TV/monitor."
73
 
74
+ examples = [["examples/example1.jpg"],
75
+ ["examples/example2.jpg"],
76
+ ["examples/example3.jpg"],
77
+ ["examples/example4.jpg"],
78
+ ["examples/example5.jpg"],
79
+ ["examples/example6.jpg"],
80
+ ["examples/example7.jpg"],
81
+ ["examples/example8.jpg"]]
82
 
83
  demo = gr.Interface(model_inference, inputs=[gr.Image(label="Input an image"),
84
+ gr.Slider(0, 1, value=0.5, label="IOU Threshold"),
85
+ gr.Slider(0, 1, value=0.4, label="Threshold"),
86
+ gr.Radio(["Yes", "No"], value="No" , label="Show GradCAM outputs"),
87
+ gr.Slider(0, 1, value=0.5, label="Opacity of GradCAM"),
88
+ gr.Slider(-2, -1, value=-1, step=1, label="Which Layer?")],
89
+ outputs=[gr.Gallery(label="Model Outputs", rows=2, columns=1, object_fit="contain", height="auto")],
90
+ title=title, description=description, examples=examples)
91
  demo.launch()
92
 
93