Downloads · 30 days
0
KoayGH/real-vs-fake-image-classifier
real-vs-fake-image-classifier is a machine learning model from KoayGH. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model classifies images as real or fake using a Vision Transformer (ViT).
Downloads · 30 days
0
Access
Public
Updated Jan 26, 2026
Repo size
343 MB
Likes
0
Public
Click a slice to open those files.
.pth343 MB · 100%
From the Hugging Face model README
This model classifies images as real or fake using a Vision Transformer (ViT).
import torch
from PIL import Image
import torchvision.transforms as transforms
# Load full model
model = torch.load("model.pth")
model.eval()
# Transform input image
transform = transforms.Compose([
transforms.Resize((224,224)),
transforms.ToTensor()
])
image = Image.open("test.jpg")
image = transform(image).unsqueeze(0)
pred = torch.argmax(model(image))
print("Prediction:", "Real" if pred.item()==1 else "Fake")