Upload MTG art CNN
Browse files- README.md +6 -5
- config.json +12 -12
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -21,16 +21,17 @@ with two softmax heads:
|
|
| 21 |
* **Colour identity** (7): White, Blue, Black, Red, Green, Colorless, Multicolor
|
| 22 |
* **Card type** (7): Creature, Planeswalker, Land, Artifact, Enchantment, Instant, Sorcery
|
| 23 |
|
| 24 |
-
It is the final project for the Skillspire AI & Machine Learning course (Nathan King
|
| 25 |
live demo is the Space [BuildITSystems/mtg-art-demo](https://huggingface.co/spaces/BuildITSystems/mtg-art-demo).
|
| 26 |
|
| 27 |
## Architecture
|
| 28 |
|
| 29 |
-
`TwoHeadCNN(width=32, blocks=[2, 2, 2, 2], dropout=0.2)`: a
|
| 30 |
residual stages (widths 32/64/128/256, stride 2 each, 8 BasicBlocks),
|
| 31 |
global average pooling and two linear heads; **2,800,366 parameters**, 5.6 MB in bf16. Input: the art crop
|
| 32 |
resized to 160x224 (HxW), normalised with the training mean/std stored in `config.json`.
|
| 33 |
-
`model.py` in
|
|
|
|
| 34 |
|
| 35 |
## Training
|
| 36 |
|
|
@@ -62,8 +63,8 @@ Single-image latency (100 images, batch 1, resize + normalise + forward + softma
|
|
| 62 |
|
| 63 |
| device | mean | p50 | p95 | vs benchmark |
|
| 64 |
|---|---:|---:|---:|---:|
|
| 65 |
-
| GPU bf16 (NVIDIA GeForce RTX 3090 Ti) | 3.
|
| 66 |
-
| CPU fp32 (16 threads) | 5.
|
| 67 |
|
| 68 |
## How to use
|
| 69 |
|
|
|
|
| 21 |
* **Colour identity** (7): White, Blue, Black, Red, Green, Colorless, Multicolor
|
| 22 |
* **Card type** (7): Creature, Planeswalker, Land, Artifact, Enchantment, Instant, Sorcery
|
| 23 |
|
| 24 |
+
It is the final project for the Skillspire AI & Machine Learning course (Nathan King). The
|
| 25 |
live demo is the Space [BuildITSystems/mtg-art-demo](https://huggingface.co/spaces/BuildITSystems/mtg-art-demo).
|
| 26 |
|
| 27 |
## Architecture
|
| 28 |
|
| 29 |
+
`TwoHeadCNN(width=32, blocks=[2, 2, 2, 2], dropout=0.2)`: a 5x5 stride-2 stem, four pre-activation
|
| 30 |
residual stages (widths 32/64/128/256, stride 2 each, 8 BasicBlocks),
|
| 31 |
global average pooling and two linear heads; **2,800,366 parameters**, 5.6 MB in bf16. Input: the art crop
|
| 32 |
resized to 160x224 (HxW), normalised with the training mean/std stored in `config.json`.
|
| 33 |
+
The complete definition is `model.py` in the demo Space
|
| 34 |
+
([BuildITSystems/mtg-art-demo](https://huggingface.co/spaces/BuildITSystems/mtg-art-demo)), byte-identical to the training code.
|
| 35 |
|
| 36 |
## Training
|
| 37 |
|
|
|
|
| 63 |
|
| 64 |
| device | mean | p50 | p95 | vs benchmark |
|
| 65 |
|---|---:|---:|---:|---:|
|
| 66 |
+
| GPU bf16 (NVIDIA GeForce RTX 3090 Ti) | 3.73 ms | 3.68 ms | 4.24 ms | 0.050x |
|
| 67 |
+
| CPU fp32 (16 threads) | 5.20 ms | 5.05 ms | 6.01 ms | 0.070x |
|
| 68 |
|
| 69 |
## How to use
|
| 70 |
|
config.json
CHANGED
|
@@ -95,11 +95,11 @@
|
|
| 95 |
}
|
| 96 |
},
|
| 97 |
"source_checkpoint": "/home/nathank/BITS/dev/MTG Card Classifier/checkpoints/light-aug/best",
|
| 98 |
-
"exported_at": "2026-10-23
|
| 99 |
"metrics_test": {
|
| 100 |
"split": "test",
|
| 101 |
"n": 3401,
|
| 102 |
-
"evaluated_at": "2026-10-23
|
| 103 |
"color": {
|
| 104 |
"accuracy": 0.3684210526315789,
|
| 105 |
"top2_accuracy": 0.5698324022346368,
|
|
@@ -117,20 +117,20 @@
|
|
| 117 |
"samples": 100,
|
| 118 |
"gpu_bf16": {
|
| 119 |
"n": 100,
|
| 120 |
-
"mean_s": 0.
|
| 121 |
-
"p50_s": 0.
|
| 122 |
-
"p95_s": 0.
|
| 123 |
-
"max_s": 0.
|
| 124 |
-
"ratio_to_benchmark": 0.
|
| 125 |
"device": "NVIDIA GeForce RTX 3090 Ti"
|
| 126 |
},
|
| 127 |
"cpu_fp32": {
|
| 128 |
"n": 100,
|
| 129 |
-
"mean_s": 0.
|
| 130 |
-
"p50_s": 0.
|
| 131 |
-
"p95_s": 0.
|
| 132 |
-
"max_s": 0.
|
| 133 |
-
"ratio_to_benchmark": 0.
|
| 134 |
"threads": 16
|
| 135 |
},
|
| 136 |
"benchmark_s": 0.074
|
|
|
|
| 95 |
}
|
| 96 |
},
|
| 97 |
"source_checkpoint": "/home/nathank/BITS/dev/MTG Card Classifier/checkpoints/light-aug/best",
|
| 98 |
+
"exported_at": "2026-10-23 20:04:46",
|
| 99 |
"metrics_test": {
|
| 100 |
"split": "test",
|
| 101 |
"n": 3401,
|
| 102 |
+
"evaluated_at": "2026-10-23 20:04:39",
|
| 103 |
"color": {
|
| 104 |
"accuracy": 0.3684210526315789,
|
| 105 |
"top2_accuracy": 0.5698324022346368,
|
|
|
|
| 117 |
"samples": 100,
|
| 118 |
"gpu_bf16": {
|
| 119 |
"n": 100,
|
| 120 |
+
"mean_s": 0.00373,
|
| 121 |
+
"p50_s": 0.00368,
|
| 122 |
+
"p95_s": 0.00424,
|
| 123 |
+
"max_s": 0.00475,
|
| 124 |
+
"ratio_to_benchmark": 0.05,
|
| 125 |
"device": "NVIDIA GeForce RTX 3090 Ti"
|
| 126 |
},
|
| 127 |
"cpu_fp32": {
|
| 128 |
"n": 100,
|
| 129 |
+
"mean_s": 0.0052,
|
| 130 |
+
"p50_s": 0.00505,
|
| 131 |
+
"p95_s": 0.00601,
|
| 132 |
+
"max_s": 0.00809,
|
| 133 |
+
"ratio_to_benchmark": 0.07,
|
| 134 |
"threads": 16
|
| 135 |
},
|
| 136 |
"benchmark_s": 0.074
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5634656
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62e48f02b52f8b2e670382054ca56088e2c50ee807147f401a4e7c0fd98eea53
|
| 3 |
size 5634656
|