ai-image-authenticity-detector

1
by
Medsa
Image Model
OTHER
New
0 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Code Examples

Usagepythonpytorch
import torch
from PIL import Image
import torchvision.transforms as T
from huggingface_hub import hf_hub_download

# Load model
path  = hf_hub_download("Medsa/ai-image-authenticity-detector", "detector_scripted.pt")
model = torch.jit.load(path, map_location="cpu")
model.eval()

# Preprocess
transform = T.Compose([
    T.Resize((32, 32)),
    T.ToTensor(),
    T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5]),
])
img    = Image.open("photo.jpg").convert("RGB")
tensor = transform(img).unsqueeze(0)   # (1, 3, 32, 32)

# Inference
with torch.no_grad():
    logit, gates = model(tensor)

fake_prob = torch.sigmoid(logit).item()
verdict   = "FAKE" if fake_prob > 0.5 else "REAL"

print(f"Verdict   : {verdict}")
print(f"Fake prob : {fake_prob:.4f}")
print(f"Real prob : {1 - fake_prob:.4f}")
print(f"Gates     : spatial={gates[0,0]:.3f}  freq={gates[0,1]:.3f}  noise={gates[0,2]:.3f}")

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.