Downloads · 30 days
0
pranjal-pravesh/prithivML-deepfake-detector-model-v1
prithivML-deepfake-detector-model-v1 is a image classification model from pranjal-pravesh. Use it when you need a label for an image. It is set up for onnx. The card lists the license as apache-2.0.
This repository contains the ONNX-optimized version of prithivMLmods/deepfake-detector-model-v1. It is a vision-based deepfake detection model built on the SigLIP architecture (SiglipForImageClassification).
Downloads · 30 days
0
Access
Public
Updated Mar 6, 2026
Repo size
343 MB
Likes
0
Public
Click a slice to open those files.
.onnx343 MB · 100%
From the Hugging Face model README
This repository contains the ONNX-optimized version of prithivMLmods/deepfake-detector-model-v1. It is a vision-based deepfake detection model built on the SigLIP architecture (SiglipForImageClassification).
0: Fake1: RealTo run this model, you will need onnxruntime and numpy. If you want to use the standard SigLIP preprocessing, the transformers library's AutoImageProcessor is recommended.
pip install onnxruntime numpy Pillow transformers
import onnxruntime as ort
import numpy as np
from PIL import Image
from transformers import AutoImageProcessor
# 1. Load the model and processor
model_path = "deepfake_detector_v1.onnx"
# You can load the processor from the original repo
processor = AutoImageProcessor.from_pretrained("prithivMLmods/deepfake-detector-model-v1")
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
# 2. Prepare the image
image = Image.open("path_to_your_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="np")
pixel_values = inputs["pixel_values"]
# 3. Run inference
outputs = session.run(["logits"], {"pixel_values": pixel_values})
logits = outputs[0]
# 4. Interpret results
probs = np.exp(logits) / np.sum(np.exp(logits), axis=-1, keepdims=True)
predicted_class = np.argmax(probs, axis=-1)[0]
id2label = {0: "Fake", 1: "Real"}
print(f"Prediction: {id2label[predicted_class]}")
print(f"Confidence: {probs[0][predicted_class]:.4f}")
pixel_values(batch_size, 3, 224, 224)float32logits(batch_size, 2)float32The model was exported using torch.onnx.export with opset 17. It features dynamic batch size support for the first dimension of input and output.