Upload README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,64 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- ocr
|
| 6 |
+
- text-detection
|
| 7 |
+
- text-recognition
|
| 8 |
+
- easyocr
|
| 9 |
+
- craft
|
| 10 |
+
- safetensors
|
| 11 |
---
|
| 12 |
+
|
| 13 |
+
# EasyOCR weights (CRAFT detector and English recogniser) in safetensors
|
| 14 |
+
|
| 15 |
+
The two pretrained models the [EasyOCR](https://github.com/JaidedAI/EasyOCR) `en` reader uses, converted from the
|
| 16 |
+
official `.pth` files to `.safetensors`. Nothing was retrained or modified: every tensor is identical, in value and dtype,
|
| 17 |
+
to the original, and the key names (including the `module.` prefix) are unchanged.
|
| 18 |
+
|
| 19 |
+
| File | Model | Tensors | SHA-256 |
|
| 20 |
+
|---|---|---|---|
|
| 21 |
+
| `craft_mlt_25k.safetensors` | CRAFT text detector | 154 | `4ab7f69bd8161b437f18f1718b8f6e58136bd081639f238b567e987415c20268` |
|
| 22 |
+
| `english_g2.safetensors` | English recogniser (CRNN, "generation 2") | 44 | `307a47690148280d00e4314b1868ebce44089d0974903a56fe7822902d1b31d0` |
|
| 23 |
+
|
| 24 |
+
`SHA256SUMS` lists the same values: `sha256sum -c SHA256SUMS`.
|
| 25 |
+
|
| 26 |
+
## Origin
|
| 27 |
+
|
| 28 |
+
Converted from the official EasyOCR release assets (EasyOCR's own MD5 values in `easyocr/config.py` are shown):
|
| 29 |
+
|
| 30 |
+
| Original | Release asset | MD5 of the original `.pth` |
|
| 31 |
+
|---|---|---|
|
| 32 |
+
| `craft_mlt_25k.pth` | https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/craft_mlt_25k.zip | `2f8227d2def4037cdb3b34389dcf9ec1` |
|
| 33 |
+
| `english_g2.pth` | https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/english_g2.zip | `5864788e1821be9e454ec108d61b887d` |
|
| 34 |
+
|
| 35 |
+
Conversion: `torch.load(..., weights_only=True)` of the state dict, then `safetensors.torch.save_file`. The saved file was
|
| 36 |
+
loaded back and compared tensor by tensor with the original (all equal). An EasyOCR reader fed these tensors returned the
|
| 37 |
+
same boxes, text and confidences as the original reader on the test images it was checked with (CPU).
|
| 38 |
+
|
| 39 |
+
## Use
|
| 40 |
+
|
| 41 |
+
These are state dicts, not a ready `easyocr.Reader` folder: EasyOCR itself only looks for MD5-checked `.pth` files, so the
|
| 42 |
+
detector and recogniser have to be built from the state dicts by the caller.
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
from safetensors.torch import load_file
|
| 46 |
+
|
| 47 |
+
craft = load_file("craft_mlt_25k.safetensors") # CRAFT state dict (keys start with "module.")
|
| 48 |
+
recog = load_file("english_g2.safetensors") # recogniser state dict (keys start with "module.")
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Licence and attribution
|
| 52 |
+
|
| 53 |
+
The files are redistributed under the licences of the projects they come from. Keep these notices with them.
|
| 54 |
+
|
| 55 |
+
- **EasyOCR**, JaidedAI: Apache License 2.0. https://github.com/JaidedAI/EasyOCR
|
| 56 |
+
- **CRAFT** (`craft_mlt_25k`), Clova AI Research, NAVER Corp.: MIT License. https://github.com/clovaai/CRAFT-pytorch.
|
| 57 |
+
Paper: Baek et al., "Character Region Awareness for Text Detection", CVPR 2019 (https://arxiv.org/abs/1904.01941).
|
| 58 |
+
EasyOCR ships Clova AI's pretrained CRAFT model.
|
| 59 |
+
- **Recognition training pipeline**, a modified version of `clovaai/deep-text-recognition-benchmark`: Apache License 2.0.
|
| 60 |
+
https://github.com/clovaai/deep-text-recognition-benchmark. Model architecture: CRNN (Shi et al., 2015).
|
| 61 |
+
|
| 62 |
+
The upstream projects publish licences for their code. The weight files carry no separate licence statement that was found,
|
| 63 |
+
so they are assumed to follow the repositories above. This repository is an unofficial conversion and is not affiliated
|
| 64 |
+
with JaidedAI or Clova AI.
|