Update app.py
Browse files
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
|
| 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()
|