Upload folder using huggingface_hub
Browse files- README.md +38 -0
- config.json +33 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- image-classification
|
| 5 |
+
- pytorch
|
| 6 |
+
- cifar10
|
| 7 |
+
datasets:
|
| 8 |
+
- uoft-cs/cifar10
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# CIFAR-10 CNN Classifier
|
| 12 |
+
|
| 13 |
+
A 3-block CNN trained from scratch on CIFAR-10 using PyTorch.
|
| 14 |
+
|
| 15 |
+
## Classes
|
| 16 |
+
plane, car, bird, cat, deer, dog, frog, horse, ship, truck
|
| 17 |
+
|
| 18 |
+
## Training
|
| 19 |
+
- Architecture: 3× Conv blocks (32→64→128 channels) + FC classifier
|
| 20 |
+
- Optimizer: Adam + OneCycleLR scheduler
|
| 21 |
+
- Augmentation: RandomCrop, RandomFlip, ColorJitter, RandomErasing
|
| 22 |
+
- Validation accuracy: ~80%+ (after 64 epochs)
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
from transformers import pipeline
|
| 28 |
+
from PIL import Image
|
| 29 |
+
|
| 30 |
+
classifier = pipeline(
|
| 31 |
+
"image-classification",
|
| 32 |
+
model="MarkivDunhar/cifar-cnn"
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
result = classifier("your_image.jpg")
|
| 36 |
+
print(result)
|
| 37 |
+
# [{'label': 'dog', 'score': 0.91}]
|
| 38 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"CifarCNNModel"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "float32",
|
| 6 |
+
"id2label": {
|
| 7 |
+
"0": "plane",
|
| 8 |
+
"1": "car",
|
| 9 |
+
"2": "bird",
|
| 10 |
+
"3": "cat",
|
| 11 |
+
"4": "deer",
|
| 12 |
+
"5": "dog",
|
| 13 |
+
"6": "frog",
|
| 14 |
+
"7": "horse",
|
| 15 |
+
"8": "ship",
|
| 16 |
+
"9": "truck"
|
| 17 |
+
},
|
| 18 |
+
"label2id": {
|
| 19 |
+
"bird": 2,
|
| 20 |
+
"car": 1,
|
| 21 |
+
"cat": 3,
|
| 22 |
+
"deer": 4,
|
| 23 |
+
"dog": 5,
|
| 24 |
+
"frog": 6,
|
| 25 |
+
"horse": 7,
|
| 26 |
+
"plane": 0,
|
| 27 |
+
"ship": 8,
|
| 28 |
+
"truck": 9
|
| 29 |
+
},
|
| 30 |
+
"model_type": "cifar-cnn",
|
| 31 |
+
"num_classes": 10,
|
| 32 |
+
"transformers_version": "5.12.1"
|
| 33 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c84dcd8c99730aa04486361b277371e7a009b88dacb2e35bdae660ebcef0a06
|
| 3 |
+
size 5375856
|