prithivMLmods commited on
Commit
c2df390
·
verified ·
1 Parent(s): 8532b5d

Update deepfake_vs_real.py

Browse files
Files changed (1) hide show
  1. 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-vs-Real-8000"
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": "Real one"
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 vs. Real Image Classification",
38
- description="Upload an image to determine if it's a Deepfake or a Real one."
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