Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 54 |
elif pred[0] >= 0.6:
|
| 55 |
-
text = "The image is
|
| 56 |
else:
|
| 57 |
-
text = "The image
|
| 58 |
|
| 59 |
else:
|
| 60 |
text = "Face is not detected in the image."
|
| 61 |
|
| 62 |
-
text2 = "
|
| 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 |
|