yuragoithf commited on
Commit
f889836
·
1 Parent(s): 3e7cd85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -60,7 +60,8 @@ def predict_class(image):
60
  def classify_image(image):
61
  results = predict_class(image)
62
  output = {labels.get(i): float(results[i]) for i in range(len(results))}
63
- return output if max(output.values()) >=1 else {"NO_CIFAR10_CLASS": 1}
 
64
 
65
 
66
  inputs = gr.inputs.Image(type="pil", label="Upload an image")
 
60
  def classify_image(image):
61
  results = predict_class(image)
62
  output = {labels.get(i): float(results[i]) for i in range(len(results))}
63
+ result = output if max(output.values()) >=0.98 else {"NO_CIFAR10_CLASS": 1}
64
+ return result
65
 
66
 
67
  inputs = gr.inputs.Image(type="pil", label="Upload an image")