Run this model with HF Jobs
Run prithivMLmods/Deepfake-Detect-Siglip2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/prithivMLmods/Deepfake-Detect-Siglip2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/prithivMLmods/Deepfake-Detect-Siglip2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use prithivMLmods/Deepfake-Detect-Siglip2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Deepfake-Detect-Siglip2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="prithivMLmods/Deepfake-Detect-Siglip2") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("prithivMLmods/Deepfake-Detect-Siglip2") model = AutoModelForImageClassification.from_pretrained("prithivMLmods/Deepfake-Detect-Siglip2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForImageClassification
processor = AutoProcessor.from_pretrained("prithivMLmods/Deepfake-Detect-Siglip2")
model = AutoModelForImageClassification.from_pretrained("prithivMLmods/Deepfake-Detect-Siglip2", device_map="auto")Deepfake-Detect-Siglip2
Deepfake-Detect-Siglip2 is an image classification vision-language encoder model fine-tuned from google/siglip2-base-patch16-224 for a single-label classification task. It is designed to detect whether an image is real or a deepfake using the SiglipForImageClassification architecture.
The model categorizes images into two classes:
- Class 0: "Fake" – The image is detected as a deepfake or manipulated.
- Class 1: "Real" – The image is classified as authentic and unaltered.
Run with Transformers🤗
!pip install -q transformers torch pillow gradio
import gradio as gr
from transformers import AutoImageProcessor
from transformers import SiglipForImageClassification
from transformers.image_utils import load_image
from PIL import Image
import torch
# Load model and processor
model_name = "prithivMLmods/Deepfake-Detect-Siglip2"
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)
def deepfake_detection(image):
"""Classifies an image as Fake or Real."""
image = Image.fromarray(image).convert("RGB")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
labels = model.config.id2label
predictions = {labels[i]: round(probs[i], 3) for i in range(len(probs))}
return predictions
# Create Gradio interface
iface = gr.Interface(
fn=deepfake_detection,
inputs=gr.Image(type="numpy"),
outputs=gr.Label(label="Detection Result"),
title="Deepfake Detection Model",
description="Upload an image to determine if it is Fake or Real."
)
# Launch the app
if __name__ == "__main__":
iface.launch()
Intended Use:
The Deepfake-Detect-Siglip2 model is designed to distinguish between real and fake (deepfake) images. It is useful for identifying AI-generated or manipulated content.
Potential Use Cases:
- Deepfake Detection: Identifying AI-generated fake images.
- Content Verification: Assisting social media platforms in filtering manipulated content.
- Forensic Analysis: Supporting cybersecurity and investigative research on fake media.
- Media Authenticity Checks: Helping journalists and fact-checkers verify image credibility.
- Downloads last month
- 332
Model tree for prithivMLmods/Deepfake-Detect-Siglip2
Base model
google/siglip2-base-patch16-224
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="prithivMLmods/Deepfake-Detect-Siglip2") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")