Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -150,7 +150,7 @@ async def predict_single_dog(image):
|
|
150 |
return top1_prob, topk_breeds, relative_probs
|
151 |
|
152 |
|
153 |
-
async def detect_multiple_dogs(image, conf_threshold=0.
|
154 |
results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
|
155 |
dogs = []
|
156 |
boxes = []
|
@@ -270,7 +270,7 @@ async def predict(image):
|
|
270 |
dogs_info += f'<div class="dog-info" style="border-left: 5px solid {color}; margin-bottom: 20px; padding: 15px;">'
|
271 |
dogs_info += f'<h2>Dog {i+1}</h2>'
|
272 |
|
273 |
-
if combined_confidence < 0.
|
274 |
dogs_info += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
|
275 |
|
276 |
elif top1_prob >= 0.45:
|
|
|
150 |
return top1_prob, topk_breeds, relative_probs
|
151 |
|
152 |
|
153 |
+
async def detect_multiple_dogs(image, conf_threshold=0.3, iou_threshold=0.45):
|
154 |
results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
|
155 |
dogs = []
|
156 |
boxes = []
|
|
|
270 |
dogs_info += f'<div class="dog-info" style="border-left: 5px solid {color}; margin-bottom: 20px; padding: 15px;">'
|
271 |
dogs_info += f'<h2>Dog {i+1}</h2>'
|
272 |
|
273 |
+
if combined_confidence < 0.2:
|
274 |
dogs_info += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
|
275 |
|
276 |
elif top1_prob >= 0.45:
|