Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -194,7 +194,7 @@ async def predict_single_dog(image):
|
|
194 |
return top1_prob, topk_breeds, topk_probs_percent
|
195 |
|
196 |
|
197 |
-
async def detect_multiple_dogs(image, conf_threshold=0.
|
198 |
results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
|
199 |
dogs = []
|
200 |
boxes = []
|
@@ -471,7 +471,7 @@ async def predict(image):
|
|
471 |
breed = topk_breeds[0]
|
472 |
description = get_dog_description(breed)
|
473 |
formatted_description = format_description(description, breed)
|
474 |
-
explanations.append(f"Dog {i+1}:
|
475 |
elif combined_confidence >= 0.2:
|
476 |
dog_explanation = f"Dog {i+1}: Top 3 possible breeds:\n"
|
477 |
dog_explanation += "\n".join([f"{j+1}. **{breed}** ({prob} confidence)" for j, (breed, prob) in enumerate(zip(topk_breeds[:3], topk_probs_percent[:3]))])
|
|
|
194 |
return top1_prob, topk_breeds, topk_probs_percent
|
195 |
|
196 |
|
197 |
+
async def detect_multiple_dogs(image, conf_threshold=0.25, iou_threshold=0.4):
|
198 |
results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
|
199 |
dogs = []
|
200 |
boxes = []
|
|
|
471 |
breed = topk_breeds[0]
|
472 |
description = get_dog_description(breed)
|
473 |
formatted_description = format_description(description, breed)
|
474 |
+
explanations.append(f"Dog {i+1}: {formatted_description}")
|
475 |
elif combined_confidence >= 0.2:
|
476 |
dog_explanation = f"Dog {i+1}: Top 3 possible breeds:\n"
|
477 |
dog_explanation += "\n".join([f"{j+1}. **{breed}** ({prob} confidence)" for j, (breed, prob) in enumerate(zip(topk_breeds[:3], topk_probs_percent[:3]))])
|