linhcuem commited on
Commit
bdbb930
1 Parent(s): 6253c3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -20,7 +20,7 @@ model = YOLO('linhcuem/chamdiem_yolov8_ver10')
20
 
21
  ###################################################
22
  def yolov8_img_inference(
23
- image: gr.inputs.Image= None,
24
  model_path: gr.inputs.Dropdown = None,
25
  image_size: gr.inputs.Slider = 640,
26
  conf_threshold: gr.inputs.Slider = 0.25,
@@ -28,12 +28,13 @@ def yolov8_img_inference(
28
  ):
29
  model = YOLO(model_path)
30
  model.overrides['conf'] = conf_threshold
31
- model.overrides['iou'] = iou_threshold
32
- model.overrides['agnostic_nms'] = False
33
- model.overrides['max_det'] = 1000
 
34
  results = model.predict(image)
35
  render = render_result(model=model, image=image, result=results[0])
36
-
37
  return render
38
 
39
  inputs_images = [
 
20
 
21
  ###################################################
22
  def yolov8_img_inference(
23
+ image: gr.inputs.Image = None,
24
  model_path: gr.inputs.Dropdown = None,
25
  image_size: gr.inputs.Slider = 640,
26
  conf_threshold: gr.inputs.Slider = 0.25,
 
28
  ):
29
  model = YOLO(model_path)
30
  model.overrides['conf'] = conf_threshold
31
+ model.overrides['iou']= iou_threshold
32
+ model.overrides['agnostic_nms'] = False # NMS class-agnostic
33
+ model.overrides['max_det'] = 1000
34
+ # image = read_image(image)
35
  results = model.predict(image)
36
  render = render_result(model=model, image=image, result=results[0])
37
+
38
  return render
39
 
40
  inputs_images = [