ILSVRC/imagenet-1k
Viewer • Updated • 1.43M • 78.5k • 815
This model is a ResNet50 architecture trained on the ImageNet dataset for image classification.
from transformers import AutoFeatureExtractor, AutoModelForImageClassification
import torch
from PIL import Image
# Load model and feature extractor
model = AutoModelForImageClassification.from_pretrained("jatingocodeo/ImageNet")
feature_extractor = AutoFeatureExtractor.from_pretrained("jatingocodeo/ImageNet")
# Prepare image
image = Image.open("path/to/image.jpg")
inputs = feature_extractor(image, return_tensors="pt")
# Get predictions
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = logits.argmax(-1).item()
The model was trained on the ImageNet dataset with the following configuration:
The model expects images to be preprocessed as follows: