Neel kamal sahu commited on
Commit
19ffff6
1 Parent(s): 8d424e9

trying to add bars in output

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -14,10 +14,9 @@ def classify_image(img):
14
 
15
  # Use the model to make a prediction
16
  prediction = model.predict(img)[0]
17
- #print(prediction)
18
  # Map the predicted class to a label
19
- dic = {'SFW': np.round(prediction[1],2), 'NSFW': np.round(prediction[0],2)}
20
- return dic#{'SFW': prediction[0][1], 'NSFW': prediction[0][0]}
21
 
22
  def classify_url(url):
23
  # Load the image from the URL
 
14
 
15
  # Use the model to make a prediction
16
  prediction = model.predict(img)[0]
 
17
  # Map the predicted class to a label
18
+ dic = {'SFW': float(prediction[1]), 'NSFW': float(prediction[0])}
19
+ return dic
20
 
21
  def classify_url(url):
22
  # Load the image from the URL