Spaces:
Running
on
Zero
Running
on
Zero
Update deepfake_vs_real.py
Browse files- deepfake_vs_real.py +4 -4
deepfake_vs_real.py
CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
|
|
7 |
import torch
|
8 |
|
9 |
# Load model and processor
|
10 |
-
model_name = "prithivMLmods/Deepfake-
|
11 |
model = SiglipForImageClassification.from_pretrained(model_name)
|
12 |
processor = AutoImageProcessor.from_pretrained(model_name)
|
13 |
|
@@ -23,7 +23,7 @@ def deepfake_classification(image):
|
|
23 |
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
|
24 |
|
25 |
labels = {
|
26 |
-
"0": "Deepfake", "1": "
|
27 |
}
|
28 |
predictions = {labels[str(i)]: round(probs[i], 3) for i in range(len(probs))}
|
29 |
|
@@ -34,8 +34,8 @@ iface = gr.Interface(
|
|
34 |
fn=deepfake_classification,
|
35 |
inputs=gr.Image(type="numpy"),
|
36 |
outputs=gr.Label(label="Prediction Scores"),
|
37 |
-
title="Deepfake
|
38 |
-
description="Upload an image to
|
39 |
)
|
40 |
|
41 |
# Launch the app
|
|
|
7 |
import torch
|
8 |
|
9 |
# Load model and processor
|
10 |
+
model_name = "prithivMLmods/Deepfake-Quality-Classifier2-SigLIP2"
|
11 |
model = SiglipForImageClassification.from_pretrained(model_name)
|
12 |
processor = AutoImageProcessor.from_pretrained(model_name)
|
13 |
|
|
|
23 |
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
|
24 |
|
25 |
labels = {
|
26 |
+
"0": "Issue In Deepfake", "1": "High Quality Deepfake"
|
27 |
}
|
28 |
predictions = {labels[str(i)]: round(probs[i], 3) for i in range(len(probs))}
|
29 |
|
|
|
34 |
fn=deepfake_classification,
|
35 |
inputs=gr.Image(type="numpy"),
|
36 |
outputs=gr.Label(label="Prediction Scores"),
|
37 |
+
title="Deepfake Quality Detection",
|
38 |
+
description="Upload an image to check its deepfake probability scores."
|
39 |
)
|
40 |
|
41 |
# Launch the app
|