File size: 1,536 Bytes
8d20b99
 
 
 
 
 
 
 
 
 
 
 
9e984cf
 
 
8d20b99
9e984cf
8d20b99
9e984cf
8d20b99
 
 
 
 
9e984cf
 
8d20b99
9e984cf
1523f39
9e984cf
8d20b99
9e984cf
1523f39
9e984cf
1523f39
9e984cf
 
 
1523f39
9e984cf
 
 
 
 
 
 
8d20b99
 
 
 
 
 
 
 
b1893fb
 
 
 
1523f39
 
b1893fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
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]