yuragoithf commited on
Commit
e56cba3
·
verified ·
1 Parent(s): 30c8ef2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -51,18 +51,18 @@ def predict_class(image):
51
  return prediction[0]
52
 
53
  # UI Design for single class output
54
- # def classify_image(image):
55
- # predicted_class = predict_class(image)
56
- # output = f"<h2>Predicted Class: <span style='text-transform:uppercase';>{predicted_class}</span></h2>"
57
- # return output
58
 
59
 
60
  # UI Design for multy class output
61
- def classify_image(image):
62
- results = predict_class(image)
63
- output = {labels.get(i): float(results[i]) for i in range(len(results))}
64
- result = output if max(output.values()) >=0.98 else {"NO_CIFAR10_CLASS": 1}
65
- return result
66
 
67
 
68
  inputs = gr.components.Image(type="pil", label="Upload an image")
 
51
  return prediction[0]
52
 
53
  # UI Design for single class output
54
+ def classify_image(image):
55
+ predicted_class = predict_class(image)
56
+ output = f"<h2>Predicted Class: <span style='text-transform:uppercase';>{predicted_class}</span></h2>"
57
+ return output
58
 
59
 
60
  # UI Design for multy class output
61
+ # def classify_image(image):
62
+ # results = predict_class(image)
63
+ # output = {labels.get(i): float(results[i]) for i in range(len(results))}
64
+ # result = output if max(output.values()) >=0.98 else {"NO_CIFAR10_CLASS": 1}
65
+ # return result
66
 
67
 
68
  inputs = gr.components.Image(type="pil", label="Upload an image")