Upload model card
Browse files
README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- image-to-text
|
| 5 |
- ocr
|
|
@@ -8,43 +10,33 @@ tags:
|
|
| 8 |
- pytorch
|
| 9 |
- cnn
|
| 10 |
- image-classification
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
- optimizer-adam
|
| 19 |
-
- weight-decay-0.0001
|
| 20 |
-
- augmentation
|
| 21 |
-
- model-type-custom
|
| 22 |
---
|
| 23 |
|
| 24 |
# Moon Cipher Detector (Classifier)
|
| 25 |
|
| 26 |
CNN classifier for **moon cipher** glyph recognition: 27 classes (A–Z plus `~`). Input: 128×128 grayscale glyph crop. Use with a detector for full image decoding.
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
| Epochs | Batch size | Learning rate | Input size | Num classes | Early stopping | Augmentation |
|
| 31 |
-
|--------|------------|---------------|------------|-------------|----------------|--------------|
|
| 32 |
-
| 150 | 16 | 3e-04 | 128×128 | 27 | 15 | True |
|
| 33 |
|
| 34 |
## Model metadata
|
| 35 |
|
| 36 |
| Model | Format | Size | Params | Tensor type |
|
| 37 |
|-------|--------|------|--------|--------------|
|
| 38 |
-
| Classifier (`
|
| 39 |
-
|
| 40 |
-
Weights are saved as **PyTorch state dict** (`.pth`), not Safetensors. Load with `torch.load(..., weights_only=True)`.
|
| 41 |
|
| 42 |
## Usage
|
| 43 |
|
| 44 |
### 1. Install
|
| 45 |
|
| 46 |
```bash
|
| 47 |
-
pip install torch torchvision huggingface_hub
|
| 48 |
```
|
| 49 |
|
| 50 |
### 2. Download from Hugging Face
|
|
@@ -52,9 +44,10 @@ pip install torch torchvision huggingface_hub
|
|
| 52 |
```python
|
| 53 |
from huggingface_hub import hf_hub_download
|
| 54 |
|
|
|
|
| 55 |
model_path = hf_hub_download(
|
| 56 |
repo_id="nhellyercreek/moon-cipher-detector",
|
| 57 |
-
filename="
|
| 58 |
)
|
| 59 |
mappings_path = hf_hub_download(
|
| 60 |
repo_id="nhellyercreek/moon-cipher-detector",
|
|
@@ -64,12 +57,13 @@ mappings_path = hf_hub_download(
|
|
| 64 |
|
| 65 |
### 3. Load and run
|
| 66 |
|
| 67 |
-
Use `MoonClassifier` from the Moon-Cipher-Detector repo (`models/moon_classifier.py`). Load with `torch.
|
| 68 |
|
| 69 |
## Config
|
| 70 |
|
| 71 |
- **Classes**: 27 (A–Z + `~`)
|
| 72 |
- **Architecture**: Custom CNN (MoonClassifier), 128×128 input.
|
| 73 |
-
- **
|
|
|
|
| 74 |
|
| 75 |
-
See `config.json` for machine-readable settings (params, size, format).
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: image-classification
|
| 5 |
tags:
|
| 6 |
- image-to-text
|
| 7 |
- ocr
|
|
|
|
| 10 |
- pytorch
|
| 11 |
- cnn
|
| 12 |
- image-classification
|
| 13 |
+
|
| 14 |
+
# Shown in model card widget (with model.safetensors)
|
| 15 |
+
model_size: "13.6M params"
|
| 16 |
+
tensor_type: "F32"
|
| 17 |
+
format: Safetensors
|
| 18 |
+
training_epochs: 150
|
| 19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
---
|
| 21 |
|
| 22 |
# Moon Cipher Detector (Classifier)
|
| 23 |
|
| 24 |
CNN classifier for **moon cipher** glyph recognition: 27 classes (A–Z plus `~`). Input: 128×128 grayscale glyph crop. Use with a detector for full image decoding.
|
| 25 |
|
| 26 |
+
**Model card (right sidebar):** This repo includes **Safetensors** (`model.safetensors`), so the Hub shows **Model size**, **Tensor type (F32)**, and format. Best checkpoint from training (up to 150 epochs).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
## Model metadata
|
| 29 |
|
| 30 |
| Model | Format | Size | Params | Tensor type |
|
| 31 |
|-------|--------|------|--------|--------------|
|
| 32 |
+
| Classifier (`model.safetensors`) | Safetensors | 51.98 MB | 13,616,347 params | F32 |
|
|
|
|
|
|
|
| 33 |
|
| 34 |
## Usage
|
| 35 |
|
| 36 |
### 1. Install
|
| 37 |
|
| 38 |
```bash
|
| 39 |
+
pip install torch torchvision huggingface_hub safetensors
|
| 40 |
```
|
| 41 |
|
| 42 |
### 2. Download from Hugging Face
|
|
|
|
| 44 |
```python
|
| 45 |
from huggingface_hub import hf_hub_download
|
| 46 |
|
| 47 |
+
# Safetensors (preferred; used for Hub widget)
|
| 48 |
model_path = hf_hub_download(
|
| 49 |
repo_id="nhellyercreek/moon-cipher-detector",
|
| 50 |
+
filename="model.safetensors"
|
| 51 |
)
|
| 52 |
mappings_path = hf_hub_download(
|
| 53 |
repo_id="nhellyercreek/moon-cipher-detector",
|
|
|
|
| 57 |
|
| 58 |
### 3. Load and run
|
| 59 |
|
| 60 |
+
Use `MoonClassifier` from the Moon-Cipher-Detector repo (`models/moon_classifier.py`). Load Safetensors with `safetensors.torch.load_file(model_path)` and `model.load_state_dict(state_dict)`, or use `best_classifier.pth` with `torch.load(..., weights_only=True)`. Input: 128×128 grayscale glyph crops.
|
| 61 |
|
| 62 |
## Config
|
| 63 |
|
| 64 |
- **Classes**: 27 (A–Z + `~`)
|
| 65 |
- **Architecture**: Custom CNN (MoonClassifier), 128×128 input.
|
| 66 |
+
- **Format**: Safetensors + PyTorch `.pth`, **tensor type**: F32.
|
| 67 |
+
- **Training**: Best checkpoint (up to 150 epochs).
|
| 68 |
|
| 69 |
+
See `config.json` for machine-readable settings (params, size, format, training_epochs).
|