Downloads · 30 days
18
3% of all-time downloads
SahilSha/SahAi
SahAi is a image classification model from SahilSha. Use it when you need a label for an image. The card lists the license as apache-2.0.
SahAi is a fine-tuned Vision Transformer (ViT) model designed for fake image localization in social media.
Downloads · 30 days
18
3% of all-time downloads
All-time downloads
678
Public
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.bin346 MB · 100%
From the Hugging Face model README
SahAi is a fine-tuned Vision Transformer (ViT) model designed for fake image localization in social media.
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")