Ron0420 commited on
Commit
a712711
1 Parent(s): faeb6c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -6,10 +6,17 @@ import tensorflow as tf
6
  import tensorflow_addons
7
  import numpy as np
8
 
 
 
 
 
 
 
 
9
 
10
  detector = MTCNN()
11
 
12
- model = tf.keras.models.load_model("FINAL-EFFICIENTNETV2-B0")
13
 
14
 
15
  def deepfakespredict(input_img):
@@ -51,13 +58,7 @@ def deepfakespredict(input_img):
51
 
52
  title="EfficientNetV2 Deepfakes Image Detector"
53
  description="This is a demo implementation of EfficientNetV2 Deepfakes Image Detector. To use it, simply upload your image, or click one of the examples to load them."
54
- examples = [
55
- ['fake-86.jpg'],
56
- ['fake-239.jpg'],
57
- ['fake-254.jpg'],
58
- ['fake-1266.jpg'],
59
- ['fake-2225.jpg']
60
- ]
61
  demo = gr.Interface(deepfakespredict,
62
  inputs = ["image"],
63
  outputs=["text","text","image"],
 
6
  import tensorflow_addons
7
  import numpy as np
8
 
9
+ import os
10
+ import zipfile
11
+
12
+ local_zip = "/FINAL-EFFICIENTNETV2-B0.zip"
13
+ zip_ref = zipfile.ZipFile(local_zip, 'r')
14
+ zip_ref.extractall('/FINAL-EFFICIENTNETV2-B0')
15
+ zip_ref.close()
16
 
17
  detector = MTCNN()
18
 
19
+ model = tf.keras.models.load_model("/FINAL-EFFICIENTNETV2-B0")
20
 
21
 
22
  def deepfakespredict(input_img):
 
58
 
59
  title="EfficientNetV2 Deepfakes Image Detector"
60
  description="This is a demo implementation of EfficientNetV2 Deepfakes Image Detector. To use it, simply upload your image, or click one of the examples to load them."
61
+ examples = []
 
 
 
 
 
 
62
  demo = gr.Interface(deepfakespredict,
63
  inputs = ["image"],
64
  outputs=["text","text","image"],