ImageNet / README.md
jatingocodeo's picture
Upload folder using huggingface_hub
8d20b99 verified
|
raw
history blame
1.3 kB
---
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 AutoImageProcessor, AutoModelForImageClassification
import torch
from PIL import Image
# Load model and processor
model = AutoModelForImageClassification.from_pretrained("jatingocodeo/ImageNet")
processor = AutoImageProcessor.from_pretrained("jatingocodeo/ImageNet")
# Prepare image
image = Image.open("path/to/image.jpg")
inputs = processor(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