Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -165,7 +165,7 @@ def predict_with_model6(image):
|
|
| 165 |
outputs = model6(**inputs)
|
| 166 |
|
| 167 |
results = processor6.post_process_object_detection(
|
| 168 |
-
outputs, target_sizes=[(h, w)], threshold=0.
|
| 169 |
)
|
| 170 |
|
| 171 |
detections = sv.Detections.from_transformers(results[0])
|
|
@@ -188,7 +188,8 @@ def predict_with_model6(image):
|
|
| 188 |
detection_info = f"🎯 Detection Results - {gpu_info}\n\n"
|
| 189 |
detection_info += f"Found {num_detections} objects:\n"
|
| 190 |
for class_id, conf, label in zip(detections.class_id, detections.confidence, labels):
|
| 191 |
-
detection_info += f"• {label} (ID {class_id}): {conf:.2f}\n"
|
|
|
|
| 192 |
|
| 193 |
return annotated_img_pil, detection_info
|
| 194 |
|
|
|
|
| 165 |
outputs = model6(**inputs)
|
| 166 |
|
| 167 |
results = processor6.post_process_object_detection(
|
| 168 |
+
outputs, target_sizes=[(h, w)], threshold=0.1
|
| 169 |
)
|
| 170 |
|
| 171 |
detections = sv.Detections.from_transformers(results[0])
|
|
|
|
| 188 |
detection_info = f"🎯 Detection Results - {gpu_info}\n\n"
|
| 189 |
detection_info += f"Found {num_detections} objects:\n"
|
| 190 |
for class_id, conf, label in zip(detections.class_id, detections.confidence, labels):
|
| 191 |
+
# detection_info += f"• {label} (ID {class_id}): {conf:.2f}\n"
|
| 192 |
+
detection_info += f"• {label} (ID {class_id})\n"
|
| 193 |
|
| 194 |
return annotated_img_pil, detection_info
|
| 195 |
|