AI_VS_Human

1
license:mit
by
SeifElden2342532
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

AlexNet — AI vs Human Image Detectorpythonpytorch
import torch
import torch.nn as nn
from torchvision import models, transforms
from torchvision.models import AlexNet_Weights
from PIL import Image
from huggingface_hub import hf_hub_download

# Rebuild the model architecture
model = models.alexnet(weights=None)
model.classifier = nn.Sequential(
    nn.Dropout(p=0.5),
    nn.Linear(9216, 4096), nn.ReLU(inplace=True),
    nn.Dropout(p=0.5),
    nn.Linear(4096, 4096), nn.ReLU(inplace=True),
    nn.Linear(4096, 1),
)

# Load weights from HF
weights_path = hf_hub_download(
    repo_id="your-username/alexnet-ai-vs-human",
    filename="alexnet_phase2_best.pth"
)
model.load_state_dict(torch.load(weights_path, map_location="cpu"))
model.eval()

# Inference
transform = transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])

img = Image.open("your_image.jpg").convert("RGB")
with torch.no_grad():
    prob = torch.sigmoid(model(transform(img).unsqueeze(0))).item()

print("AI" if prob > 0.5 else "Human", f"({prob:.2%} confidence)")

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.