Wvolf commited on
Commit
310647f
1 Parent(s): 1d248b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,5 +1,5 @@
1
- import numpy as np
2
- from PIL import Image, ImageOps
3
  import gradio as gr
4
  from tensorflow.keras.utils import img_to_array
5
  from tensorflow.keras.models import load_model
@@ -8,10 +8,10 @@ import os
8
  model = load_model(r'deepfake_detection_model.h5')
9
 
10
  def predict_image(img):
11
-
12
- img = ImageOps.fit(img, (256, 256), Image.ANTIALIAS)
13
 
14
  x = img_to_array(img)
 
 
15
 
16
  x /= 255.0
17
 
 
1
+ import cv2
2
+ import numpy as np
3
  import gradio as gr
4
  from tensorflow.keras.utils import img_to_array
5
  from tensorflow.keras.models import load_model
 
8
  model = load_model(r'deepfake_detection_model.h5')
9
 
10
  def predict_image(img):
 
 
11
 
12
  x = img_to_array(img)
13
+
14
+ x = cv2.resize(x, (256, 256), interpolation=cv2.INTER_AREA)
15
 
16
  x /= 255.0
17