Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,9 +25,9 @@ import dlib
|
|
| 25 |
num_bins = 256
|
| 26 |
|
| 27 |
# Load the model
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
model3 = load_model('best_model_HQ_enhanced_v12.h5')
|
| 31 |
def u_sliding_factor(image_channel, P):
|
| 32 |
result = np.zeros(image_channel.shape, np.float32)
|
| 33 |
|
|
@@ -234,23 +234,23 @@ if picture:
|
|
| 234 |
X_array = np.array(features_list)
|
| 235 |
# print(X_array.shape)
|
| 236 |
X_test_array_reshaped = np.expand_dims(X_array, axis=-1)
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
prediction3 = model3.predict(X_test_array_reshaped)
|
| 240 |
-
if prediction3 >=0.85:
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
else:
|
| 244 |
-
st.text("Fack")
|
| 245 |
-
st.text(str(prediction3[0]))
|
| 246 |
-
# if prediction >= 0.85 and prediction2 >= 0.0000000000001:
|
| 247 |
-
# st.text("صورة حقيقية")
|
| 248 |
-
# # st.text(str(prediction[0]))
|
| 249 |
-
# # st.text(str(prediction2[0]))
|
| 250 |
# else:
|
| 251 |
-
# st.text("
|
| 252 |
-
# st.text(str(
|
| 253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
else:
|
| 255 |
st.text("لا يوجد وجه")
|
| 256 |
else:
|
|
|
|
| 25 |
num_bins = 256
|
| 26 |
|
| 27 |
# Load the model
|
| 28 |
+
model = load_model('best_model_HQ_v11.h5')
|
| 29 |
+
model2 = load_model('best_model_HQ_v9.h5')
|
| 30 |
+
# model3 = load_model('best_model_HQ_enhanced_v12.h5')
|
| 31 |
def u_sliding_factor(image_channel, P):
|
| 32 |
result = np.zeros(image_channel.shape, np.float32)
|
| 33 |
|
|
|
|
| 234 |
X_array = np.array(features_list)
|
| 235 |
# print(X_array.shape)
|
| 236 |
X_test_array_reshaped = np.expand_dims(X_array, axis=-1)
|
| 237 |
+
prediction = model.predict(X_test_array_reshaped)
|
| 238 |
+
prediction2 = model2.predict(X_test_array_reshaped)
|
| 239 |
+
# prediction3 = model3.predict(X_test_array_reshaped)
|
| 240 |
+
# if prediction3 >=0.85:
|
| 241 |
+
# st.text("Real")
|
| 242 |
+
# st.text(str(prediction3[0]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
# else:
|
| 244 |
+
# st.text("Fack")
|
| 245 |
+
# st.text(str(prediction3[0]))
|
| 246 |
+
if prediction >= 0.85 and prediction2 >= 0.0000000000001:
|
| 247 |
+
st.text("صورة حقيقية")
|
| 248 |
+
# st.text(str(prediction[0]))
|
| 249 |
+
# st.text(str(prediction2[0]))
|
| 250 |
+
else:
|
| 251 |
+
st.text("صورة مزيفة")
|
| 252 |
+
st.text(str(prediction[0]))
|
| 253 |
+
# st.text(str(prediction2[0]))
|
| 254 |
else:
|
| 255 |
st.text("لا يوجد وجه")
|
| 256 |
else:
|