Ron0420 commited on
Commit
0c0568f
1 Parent(s): 760f875

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -50,16 +50,16 @@ def deepfakespredict(input_img ):
50
  pred = model.predict(np.expand_dims(face_image4, axis=0))[0]
51
 
52
  if pred[1] >= 0.6:
53
- text = "The image is fake."
54
  elif pred[0] >= 0.6:
55
- text = "The image is real."
56
  else:
57
- text = "The image might be real or fake."
58
 
59
  else:
60
  text = "Face is not detected in the image."
61
 
62
- text2 = "Real: " + str(np.round(pred[0]*100, 2)) + "%, Fake: " + str(np.round(pred[1]*100, 2)) + "%"
63
 
64
  return input_img, text, text2, {labels[i]: float(pred[i]) for i in range(2)}
65
 
 
50
  pred = model.predict(np.expand_dims(face_image4, axis=0))[0]
51
 
52
  if pred[1] >= 0.6:
53
+ text = "The image is FAKE."
54
  elif pred[0] >= 0.6:
55
+ text = "The image is REAL."
56
  else:
57
+ text = "The image may be REAL or FAKE."
58
 
59
  else:
60
  text = "Face is not detected in the image."
61
 
62
+ text2 = "REAL: " + str(np.round(pred[0]*100, 2)) + "%, FAKE: " + str(np.round(pred[1]*100, 2)) + "%"
63
 
64
  return input_img, text, text2, {labels[i]: float(pred[i]) for i in range(2)}
65