DawnC commited on
Commit
a5727d0
·
1 Parent(s): 5fbe3b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -317,6 +317,8 @@ async def predict(image):
317
  draw.text((box[0] + 5, box[1] + 5), f"Dog {i+1}", fill=color, font=font)
318
 
319
  combined_confidence = detection_confidence * top1_prob
 
 
320
  dogs_info += f'<div class="dog-info" style="border-left: 5px solid {color}; margin-bottom: 20px; padding: 15px;">'
321
  dogs_info += f'<h2>Dog {i+1}</h2>'
322
 
@@ -326,6 +328,7 @@ async def predict(image):
326
  dogs_info += format_description_html(description, breed)
327
 
328
  elif combined_confidence >= 0.15:
 
329
  dogs_info += f"<p>Top 3 possible breeds:</p><ul>"
330
  for j, (breed, prob) in enumerate(zip(topk_breeds[:3], topk_probs_percent[:3])):
331
  prob = float(prob.replace('%', ''))
@@ -353,7 +356,6 @@ async def predict(image):
353
  """
354
 
355
 
356
-
357
 
358
 
359
  if buttons:
 
317
  draw.text((box[0] + 5, box[1] + 5), f"Dog {i+1}", fill=color, font=font)
318
 
319
  combined_confidence = detection_confidence * top1_prob
320
+ print(f"Combined confidence for Dog {i+1}: {combined_confidence}") # 檢查confidence
321
+
322
  dogs_info += f'<div class="dog-info" style="border-left: 5px solid {color}; margin-bottom: 20px; padding: 15px;">'
323
  dogs_info += f'<h2>Dog {i+1}</h2>'
324
 
 
328
  dogs_info += format_description_html(description, breed)
329
 
330
  elif combined_confidence >= 0.15:
331
+ print(f"Entering button generation for Dog {i+1}") # 確認進入了這部分
332
  dogs_info += f"<p>Top 3 possible breeds:</p><ul>"
333
  for j, (breed, prob) in enumerate(zip(topk_breeds[:3], topk_probs_percent[:3])):
334
  prob = float(prob.replace('%', ''))
 
356
  """
357
 
358
 
 
359
 
360
 
361
  if buttons: