Update pipeline.py
Browse files- pipeline.py +4 -1
pipeline.py
CHANGED
|
@@ -143,10 +143,13 @@ def deepfakes_image_predict(input_image):
|
|
| 143 |
face2 = faces / 255.0
|
| 144 |
pred = model.predict(np.expand_dims(face2, axis=0))[0]
|
| 145 |
real, fake = pred[0], pred[1]
|
|
|
|
| 146 |
if real > 0.5:
|
| 147 |
text2 = "The image is REAL. \n Deepfakes Confidence: " + str(round(100 - (real * 100), 3)) + "%"
|
| 148 |
else:
|
| 149 |
-
|
|
|
|
|
|
|
| 150 |
return text2
|
| 151 |
|
| 152 |
# ---------------------------------------------------------
|
|
|
|
| 143 |
face2 = faces / 255.0
|
| 144 |
pred = model.predict(np.expand_dims(face2, axis=0))[0]
|
| 145 |
real, fake = pred[0], pred[1]
|
| 146 |
+
|
| 147 |
if real > 0.5:
|
| 148 |
text2 = "The image is REAL. \n Deepfakes Confidence: " + str(round(100 - (real * 100), 3)) + "%"
|
| 149 |
else:
|
| 150 |
+
# Fixed the parenthesis placement here
|
| 151 |
+
text2 = "The image is FAKE. \n Deepfakes Confidence: " + str(round(fake * 100, 3)) + "%"
|
| 152 |
+
|
| 153 |
return text2
|
| 154 |
|
| 155 |
# ---------------------------------------------------------
|