DawnC commited on
Commit
08d39af
1 Parent(s): ed6f326

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -221,7 +221,7 @@ def calculate_iou(box1, box2):
221
 
222
  async def process_single_dog(image):
223
  top1_prob, topk_breeds, topk_probs_percent = await predict_single_dog(image)
224
- if top1_prob < 0.2:
225
  initial_state = {
226
  "explanation": "The image is unclear or the breed is not in the dataset. Please upload a clearer image of a dog.",
227
  "buttons": [],
@@ -234,7 +234,7 @@ async def process_single_dog(image):
234
  breed = topk_breeds[0]
235
  description = get_dog_description(breed)
236
 
237
- if top1_prob >= 0.5:
238
  formatted_description = format_description(description, breed)
239
  initial_state = {
240
  "explanation": formatted_description,
 
221
 
222
  async def process_single_dog(image):
223
  top1_prob, topk_breeds, topk_probs_percent = await predict_single_dog(image)
224
+ if top1_prob < 0.15:
225
  initial_state = {
226
  "explanation": "The image is unclear or the breed is not in the dataset. Please upload a clearer image of a dog.",
227
  "buttons": [],
 
234
  breed = topk_breeds[0]
235
  description = get_dog_description(breed)
236
 
237
+ if top1_prob >= 0.45:
238
  formatted_description = format_description(description, breed)
239
  initial_state = {
240
  "explanation": formatted_description,