yoloKYS commited on
Commit
313686f
·
verified ·
1 Parent(s): 616a25b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,12 +20,12 @@ def detect_objects(image):
20
  # Convert PIL to RGB NumPy array (YOLO expects RGB)
21
  img = np.array(image.convert("RGB"))
22
 
23
- # Run prediction with tuned thresholds
24
  results = model.predict(
25
  source=img,
26
- imgsz=640, # same as training
27
- conf=0.5, # higher confidence threshold to reduce duplicates
28
- iou=0.45, # standard NMS threshold
29
  verbose=False
30
  )
31
 
 
20
  # Convert PIL to RGB NumPy array (YOLO expects RGB)
21
  img = np.array(image.convert("RGB"))
22
 
23
+ # Run prediction with same settings used during training
24
  results = model.predict(
25
  source=img,
26
+ imgsz=640, # same resolution as training
27
+ conf=0.25, # lower confidence threshold to catch subtle detections
28
+ iou=0.45, # standard non-max suppression
29
  verbose=False
30
  )
31