Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 24 |
results = model.predict(
|
| 25 |
source=img,
|
| 26 |
-
imgsz=640, # same as training
|
| 27 |
-
conf=0.
|
| 28 |
-
iou=0.45, # standard
|
| 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 |
|