EngAbod commited on
Commit
aaf85a5
·
1 Parent(s): 79ea3c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -11
app.py CHANGED
@@ -25,8 +25,9 @@ import dlib
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
  def u_sliding_factor(image_channel, P):
31
  result = np.zeros(image_channel.shape, np.float32)
32
 
@@ -233,16 +234,23 @@ if picture:
233
  X_array = np.array(features_list)
234
  # print(X_array.shape)
235
  X_test_array_reshaped = np.expand_dims(X_array, axis=-1)
236
- prediction = model.predict(X_test_array_reshaped)
237
- prediction2 = model2.predict(X_test_array_reshaped)
238
- if prediction >= 0.85 and prediction2 >= 0.0000000000001:
239
- st.text("صورة حقيقية")
240
- # st.text(str(prediction[0]))
241
- # st.text(str(prediction2[0]))
242
  else:
243
- st.text("صورة مزيفة")
244
- st.text(str(prediction[0]))
245
- # st.text(str(prediction2[0]))
 
 
 
 
 
 
 
246
  else:
247
  st.text("لا يوجد وجه")
248
  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: