thugCodeNinja commited on
Commit
5b7a525
1 Parent(s): 119338f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -69,7 +69,7 @@ class DetectionPipeline:
69
 
70
  detection_pipeline = DetectionPipeline(detector=mtcnn, n_frames=20, batch_size=60)
71
 
72
- model = tf.keras.models.load_model("p1")
73
 
74
  def deepfakespredict(input_video):
75
  faces = detection_pipeline(input_video)
@@ -79,8 +79,8 @@ def deepfakespredict(input_video):
79
  fake = 0
80
 
81
  for face in faces:
82
- face2 = face / 255
83
- pred = model.predict(np.expand_dims(face2, axis=0))[0]
84
  total += 1
85
 
86
  pred2 = pred[1]
 
69
 
70
  detection_pipeline = DetectionPipeline(detector=mtcnn, n_frames=20, batch_size=60)
71
 
72
+ model = tf.saved_model.load("p1")
73
 
74
  def deepfakespredict(input_video):
75
  faces = detection_pipeline(input_video)
 
79
  fake = 0
80
 
81
  for face in faces:
82
+ face2 = (face / 255).astype(np.float32)
83
+ pred = model(np.expand_dims(face2, axis=0))[0]
84
  total += 1
85
 
86
  pred2 = pred[1]