Ron0420 commited on
Commit
c8f1002
1 Parent(s): 1efcd67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -34,7 +34,9 @@ detector = MTCNN()
34
 
35
  def deepfakespredict(select_model, input_img ):
36
 
37
- tf.keras.backend.clear_session()
 
 
38
 
39
  if select_model == "EfficientNetV2-B0":
40
  model = model_b0
@@ -72,7 +74,7 @@ def deepfakespredict(select_model, input_img ):
72
 
73
  title="EfficientNetV2 Deepfakes Image Detector"
74
  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."
75
- examples = [
76
  ['deepfakes-test-images/Fake-1.jpg'],
77
  ['deepfakes-test-images/Fake-2.jpg'],
78
  ['deepfakes-test-images/Fake-3.jpg'],
@@ -84,6 +86,7 @@ examples = [
84
  ['deepfakes-test-images/Real-3.jpg'],
85
  ['deepfakes-test-images/Real-4.jpg'],
86
  ['deepfakes-test-images/Real-5.jpg']
 
87
  ]
88
 
89
  gr.Interface(deepfakespredict,
@@ -91,4 +94,5 @@ gr.Interface(deepfakespredict,
91
  outputs=["text", gr.outputs.Image(type="pil", label="Detected face"), gr.outputs.Label(num_top_classes=None, type="auto", label="Confidence")],
92
  title=title,
93
  description=description
 
94
  ).launch()
 
34
 
35
  def deepfakespredict(select_model, input_img ):
36
 
37
+ model = []
38
+ labels = ['real', 'fake']
39
+ pred = [0, 0]
40
 
41
  if select_model == "EfficientNetV2-B0":
42
  model = model_b0
 
74
 
75
  title="EfficientNetV2 Deepfakes Image Detector"
76
  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."
77
+ examples = [ [],[
78
  ['deepfakes-test-images/Fake-1.jpg'],
79
  ['deepfakes-test-images/Fake-2.jpg'],
80
  ['deepfakes-test-images/Fake-3.jpg'],
 
86
  ['deepfakes-test-images/Real-3.jpg'],
87
  ['deepfakes-test-images/Real-4.jpg'],
88
  ['deepfakes-test-images/Real-5.jpg']
89
+ ]
90
  ]
91
 
92
  gr.Interface(deepfakespredict,
 
94
  outputs=["text", gr.outputs.Image(type="pil", label="Detected face"), gr.outputs.Label(num_top_classes=None, type="auto", label="Confidence")],
95
  title=title,
96
  description=description
97
+ examples=examples
98
  ).launch()