Ron0420 commited on
Commit
f2bbbf2
1 Parent(s): a9b746b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -26,7 +26,7 @@ model_s = tf.keras.models.load_model("FINAL-EFFICIENTNETV2-S")
26
  detector = MTCNN()
27
 
28
 
29
- def deepfakespredict(input_img, select_model):
30
 
31
  tf.keras.backend.clear_session()
32
 
@@ -66,11 +66,27 @@ def deepfakespredict(input_img, select_model):
66
 
67
  title="EfficientNetV2 Deepfakes Image Detector"
68
  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."
69
- examples = []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  gr.Interface(deepfakespredict,
71
  inputs = [gr.inputs.Radio(["EfficientNetV2-B0", "EfficientNetV2-S"], label = "Select model:"), "image"],
72
  outputs=["text", gr.outputs.Image(type="pil", label="Detected face"), gr.outputs.Label(num_top_classes=None, type="auto", label="Confidence")],
73
  title=title,
74
- description=description
75
-
76
  ).launch()
 
26
  detector = MTCNN()
27
 
28
 
29
+ def deepfakespredict(select_model, input_img ):
30
 
31
  tf.keras.backend.clear_session()
32
 
 
66
 
67
  title="EfficientNetV2 Deepfakes Image Detector"
68
  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."
69
+ examples = [
70
+ [
71
+ ['deepfakes-test-images/Fake-1.jpg'],
72
+ ['deepfakes-test-images/Fake-2.jpg'],
73
+ ['deepfakes-test-images/Fake-3.jpg'],
74
+ ['deepfakes-test-images/Fake-4.jpg'],
75
+ ['deepfakes-test-images/Fake-5.jpg']
76
+ ],
77
+ [
78
+ ['deepfakes-test-images/Real-1.jpg'],
79
+ ['deepfakes-test-images/Real-2.jpg'],
80
+ ['deepfakes-test-images/Real-3.jpg'],
81
+ ['deepfakes-test-images/Real-4.jpg'],
82
+ ['deepfakes-test-images/Real-5.jpg'],
83
+ ]
84
+ ]
85
+
86
  gr.Interface(deepfakespredict,
87
  inputs = [gr.inputs.Radio(["EfficientNetV2-B0", "EfficientNetV2-S"], label = "Select model:"), "image"],
88
  outputs=["text", gr.outputs.Image(type="pil", label="Detected face"), gr.outputs.Label(num_top_classes=None, type="auto", label="Confidence")],
89
  title=title,
90
+ description=description,
91
+ examples = examples
92
  ).launch()