SadraCoding commited on
Commit
9605716
Β·
verified Β·
1 Parent(s): 989bccf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,14 +1,13 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
-
5
  classifier = pipeline("image-classification", model="SADRACODING/SDXL-Deepfake-Detector")
6
 
7
  def predict(image):
8
  if image is None:
9
  return None
10
  results = classifier(image)
11
- return result["label"]
12
 
13
  gr.Interface(
14
  fn=predict,
@@ -16,5 +15,8 @@ gr.Interface(
16
  outputs=gr.Label(label="Prediction"),
17
  title="πŸ” SDXL Deepfake Detector",
18
  description="Upload a face image to detect if it's AI-generated (deepfake) or real.",
19
- examples=[]
 
 
 
20
  ).launch()
 
1
  from transformers import pipeline
2
  import gradio as gr
3
 
 
4
  classifier = pipeline("image-classification", model="SADRACODING/SDXL-Deepfake-Detector")
5
 
6
  def predict(image):
7
  if image is None:
8
  return None
9
  results = classifier(image)
10
+ return results[0]["label"]
11
 
12
  gr.Interface(
13
  fn=predict,
 
15
  outputs=gr.Label(label="Prediction"),
16
  title="πŸ” SDXL Deepfake Detector",
17
  description="Upload a face image to detect if it's AI-generated (deepfake) or real.",
18
+ examples=[
19
+ ["example_real.jpg"],
20
+ ["example_fake.jpg"]
21
+ ]
22
  ).launch()