Downloads · 30 days
6
3% of all-time downloads
harshai-a/HarsAI
HarsAI is a machine learning model from harshai-a. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
207
Public
Repo size
687 MB
Likes
0
Public
Click a slice to open those files.
.bin343 MB · 100%
From the Hugging Face model README
Hugging Face's logo
harshai-a / HarsAI
like 0 Image Classification PyTorch
ciplab/real-and-fake-face-detection vit vision transformer fake-image-detection Eval Results
License: apache-2.0 Model card Files Community 1 HarsAi / README.md
HarsAi's picture harshai-a Update README.md 5d677cb verified preview code | raw
Copy download link history blame contribute delete
tags:
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("harshai-a/HarsAI")
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")