File size: 1,444 Bytes
5d677cb 8c9d36b 5d677cb 8c9d36b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
---
tags:
- vision
- image-classification
- vit
- transformer
- fake-image-detection
license: apache-2.0
datasets:
- ciplab/real-and-fake-face-detection
model-index:
- name: SahAi
results:
- task:
name: Image Classification
type: image-classification
dataset:
name: Real and Fake Face Detection Dataset
type: ciplab/real-and-fake-face-detection
metrics:
- name: Accuracy
type: accuracy
value: 99.12
- name: Precision
type: precision
value: 98.95
- name: Recall
type: recall
value: 99.00
---
# SahAi - Enhanced Fake Image Detection Model
**SahAi** is a fine-tuned Vision Transformer (ViT) model designed for fake image localization in social media.
### 🚀 Model Description
- **Base Model:** ViT-B/16
- **Input Size:** 224x224
- **Output Classes:** Real (0), Fake (1)
### 🔥 How to Use
```python
from transformers import ViTForImageClassification, AutoFeatureExtractor
from PIL import Image
import torch
model = ViTForImageClassification.from_pretrained("SahilSha/SahAi")
feature_extractor = AutoFeatureExtractor.from_pretrained("google/vit-base-patch16-224-in21k")
image = Image.open("test_image.jpg").convert("RGB")
inputs = feature_extractor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
prediction = outputs.logits.argmax(-1).item()
print("Real" if prediction == 0 else "Fake") |