elhamb commited on
Commit
0807028
·
verified ·
1 Parent(s): 2a20d23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,9 +52,9 @@ def predict_image(input_img_pil):
52
 
53
  # 4. Format the output for Gradio's Label component
54
  # Assuming predictions is a 2-element array: [prob_cat, prob_dog]
55
-
56
- return {"dog":predictions[0][0],"cat":1-predictions[0][0]}
57
-
58
  except Exception as e:
59
  # Catch any error, log it, and return it to the user in a visible format
60
  error_message = f"CRITICAL RUNTIME ERROR: {str(e)}"
 
52
 
53
  # 4. Format the output for Gradio's Label component
54
  # Assuming predictions is a 2-element array: [prob_cat, prob_dog]
55
+ pdog=float(predictions[0][0])
56
+ return {"dog":pdog,"cat":1-pdog}
57
+ s
58
  except Exception as e:
59
  # Catch any error, log it, and return it to the user in a visible format
60
  error_message = f"CRITICAL RUNTIME ERROR: {str(e)}"