DawnC commited on
Commit
97ec987
1 Parent(s): c10948d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -167,7 +167,7 @@ async def predict_single_dog(image):
167
  return top1_prob, topk_breeds, topk_probs_percent
168
 
169
 
170
- async def detect_multiple_dogs(image, conf_threshold=0.3, iou_threshold=0.55):
171
  results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
172
  dogs = []
173
  boxes = []
@@ -288,7 +288,9 @@ async def predict(image):
288
  top1_prob, topk_breeds, topk_probs_percent = await predict_single_dog(cropped_image)
289
  color = color_list[i % len(color_list)]
290
  draw.rectangle(box, outline=color, width=3)
291
- draw.text((box[0], box[1]), f"Dog {i+1}", fill=color, font=font)
 
 
292
 
293
  combined_confidence = detection_confidence * top1_prob
294
 
 
167
  return top1_prob, topk_breeds, topk_probs_percent
168
 
169
 
170
+ async def detect_multiple_dogs(image, conf_threshold=0.4, iou_threshold=0.55):
171
  results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
172
  dogs = []
173
  boxes = []
 
288
  top1_prob, topk_breeds, topk_probs_percent = await predict_single_dog(cropped_image)
289
  color = color_list[i % len(color_list)]
290
  draw.rectangle(box, outline=color, width=3)
291
+ #draw.text((box[0], box[1]), f"Dog {i+1}", fill=color, font=font)
292
+ draw.text((box[0] + 5, box[1] + 5), f"Dog {i+1}", fill=color, font=font)
293
+
294
 
295
  combined_confidence = detection_confidence * top1_prob
296