umutkavakli commited on
Commit
6f96436
1 Parent(s): 1af0481

examples added for users

Browse files
app.py CHANGED
@@ -1,6 +1,14 @@
1
  import gradio as gr
2
  from detection import ObjectDetection
3
 
 
 
 
 
 
 
 
 
4
  def get_predictions(img, threshold, box_color, text_color):
5
  v3_results = yolov3_detector.score_frame(img)
6
  v5_results = yolov5_detector.score_frame(img)
@@ -42,6 +50,9 @@ with gr.Blocks(title="Leaf Disease Detection", theme=gr.themes.Monochrome()) as
42
  [image, confidence, box_color, text_color],
43
  [v3_prediction, v5_prediction, v8_prediction]
44
  )
 
 
 
45
 
46
 
47
  yolov3_detector = ObjectDetection('yolov3')
 
1
  import gradio as gr
2
  from detection import ObjectDetection
3
 
4
+ examples = [
5
+ ['test-images/toma_TMV_jpg.rf.fadfed6938fbeef46c39f78a02da3be4.jpg', 0.31],
6
+ ['test-images/99e886623c2080c22f6519b0e708c531_jpg.rf.83ea9a32bc50cfb2da6e4a39337532cc.jpg', 0.51],
7
+ ['test-images/early-blight-septoria-ls-fig-3_jpg.rf.7b2e29c077910e0930c16d7aed136121.jpg', 0.39],
8
+ ['test-images/glyphosate_jpg.rf.01dea2d24a1e3591855a68e077bb625e.jpg', 0.54],
9
+ ['test-images/image_jpg.rf.d37866429a917dd1bc5352ea1454a472.jpg', 0.41]
10
+ ]
11
+
12
  def get_predictions(img, threshold, box_color, text_color):
13
  v3_results = yolov3_detector.score_frame(img)
14
  v5_results = yolov5_detector.score_frame(img)
 
50
  [image, confidence, box_color, text_color],
51
  [v3_prediction, v5_prediction, v8_prediction]
52
  )
53
+
54
+ with gr.Row():
55
+ gr.Examples(examples=examples, inputs=[image, confidence])
56
 
57
 
58
  yolov3_detector = ObjectDetection('yolov3')
test-images/99e886623c2080c22f6519b0e708c531_jpg.rf.83ea9a32bc50cfb2da6e4a39337532cc.jpg ADDED
test-images/early-blight-septoria-ls-fig-3_jpg.rf.7b2e29c077910e0930c16d7aed136121.jpg ADDED
test-images/glyphosate_jpg.rf.01dea2d24a1e3591855a68e077bb625e.jpg ADDED
test-images/image_jpg.rf.d37866429a917dd1bc5352ea1454a472.jpg ADDED
test-images/toma_TMV_jpg.rf.fadfed6938fbeef46c39f78a02da3be4.jpg ADDED