ImageNet / README.md
jatingocodeo's picture
Upload folder using huggingface_hub
1523f39 verified
---
language: en
tags:
- image-classification
- pytorch
- resnet
- imagenet
datasets:
- imagenet-1k
metrics:
- accuracy
---
# ResNet50 ImageNet Classifier
This model is a ResNet50 architecture trained on the ImageNet dataset for image classification.
## Model Description
- **Model Type:** ResNet50
- **Task:** Image Classification
- **Training Data:** ImageNet (ILSVRC2012)
- **Number of Parameters:** ~23M
- **Input:** RGB images of size 224x224
## Usage
```python
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()
```
## Training
The model was trained on the ImageNet dataset with the following configuration:
- Optimizer: AdamW
- Learning Rate: 0.003 with cosine scheduling
- Batch Size: 256
- Data Augmentation: RandomResizedCrop, RandomHorizontalFlip, ColorJitter, RandomAffine, RandomPerspective
## Preprocessing
The model expects images to be preprocessed as follows:
- Resize shortest edge to 224
- Center crop to 224x224
- Normalize with mean [0.485, 0.456, 0.406] and std [0.229, 0.224, 0.225]