Ahmed235 commited on
Commit
d559116
·
verified ·
1 Parent(s): 2311e16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -33,13 +33,9 @@ def predict_image(image):
33
  outputs = model(img_array)
34
  predictions = tf.nn.softmax(outputs.logits, axis=-1)
35
  predicted_class = np.argmax(predictions)
36
- if predicted_class == 0:
37
- predict_label = "Clean"
38
- else:
39
- predict_label = "Carries"
40
  #confidence = float(np.max(predictions))
41
- prediction_dict = {"prediction": predict_label}
42
- return json.dumps(prediction_dict, indent=1)
43
 
44
  # Create the interface
45
  input_interface = gr.Image(type = "pil")
 
33
  outputs = model(img_array)
34
  predictions = tf.nn.softmax(outputs.logits, axis=-1)
35
  predicted_class = np.argmax(predictions)
 
 
 
 
36
  #confidence = float(np.max(predictions))
37
+ return{"prediction": predicted_class}
38
+ #return json.dumps(prediction_dict, indent=1)
39
 
40
  # Create the interface
41
  input_interface = gr.Image(type = "pil")