Image Classification
timm
ONNX
Safetensors
ocr
script-identification
page-classification
document-ai
multi-label
glam
hf_jobs
Instructions to use davanstrien/page-script-id-agent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use davanstrien/page-script-id-agent with timm:
import timm model = timm.create_model("hf-hub:davanstrien/page-script-id-agent", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Card: language tags, Jobs in the intro, prominent threshold note
Browse files
README.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
library_name: onnx
|
| 4 |
pipeline_tag: image-classification
|
| 5 |
base_model: timm/mobilenetv4_conv_small.e2400_r224_in1k
|
|
@@ -25,6 +62,10 @@ A small image model that looks at a whole document page and says which writing s
|
|
| 25 |
|
| 26 |
MobileNetV4-conv-small, 2.5M parameters, 10 MB ONNX file. Greyscale page squashed to 640 × 640. 33 ms per page on one CPU thread, 12 ms on four (model only).
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
Scripts: Arabic, Armenian, Bengali, Cyrillic, Devanagari, Ethiopic, Georgian, Greek, Gujarati, Han, Hangul, Hebrew, Japanese, Kannada, Khmer, Latin, Malayalam, Myanmar, Tamil, Telugu, Thai.
|
| 29 |
|
| 30 |
## Quick start
|
|
@@ -87,7 +128,7 @@ Preprocessing matters: grey, bilinear squash to 640 × 640 (no crop, no padding)
|
|
| 87 |
- **Several scripts:** two or more at or above it, usually a mixed page.
|
| 88 |
- **No text:** not an output of this model. Blank pages usually come out "unknown", but not always. Take "no text" from a separate no-text model, such as the `no_text` output of [page-ocr-flags](https://huggingface.co/small-models-for-glam/page-ocr-flags).
|
| 89 |
|
| 90 |
-
0.627 is the value at which 95% of 2,071 validation pages are still answered; the temperature was fitted on the same pages.
|
| 91 |
|
| 92 |
**Why 0.55 for the script threshold.** It is the value chosen on the validation pages for this checkpoint. A lower value finds more mixed pages but gives more single-script pages a spurious second script. Computed for this card from the saved predictions on the 2,056 web-PDF test pages (unknown 5.3% in both cases):
|
| 93 |
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- multilingual
|
| 5 |
+
- en
|
| 6 |
+
- de
|
| 7 |
+
- fr
|
| 8 |
+
- es
|
| 9 |
+
- pt
|
| 10 |
+
- it
|
| 11 |
+
- nl
|
| 12 |
+
- sv
|
| 13 |
+
- pl
|
| 14 |
+
- tr
|
| 15 |
+
- id
|
| 16 |
+
- vi
|
| 17 |
+
- ru
|
| 18 |
+
- uk
|
| 19 |
+
- el
|
| 20 |
+
- ar
|
| 21 |
+
- fa
|
| 22 |
+
- ur
|
| 23 |
+
- he
|
| 24 |
+
- hi
|
| 25 |
+
- bn
|
| 26 |
+
- gu
|
| 27 |
+
- ta
|
| 28 |
+
- te
|
| 29 |
+
- kn
|
| 30 |
+
- ml
|
| 31 |
+
- th
|
| 32 |
+
- km
|
| 33 |
+
- my
|
| 34 |
+
- ka
|
| 35 |
+
- hy
|
| 36 |
+
- am
|
| 37 |
+
- zh
|
| 38 |
+
- ja
|
| 39 |
+
- ko
|
| 40 |
library_name: onnx
|
| 41 |
pipeline_tag: image-classification
|
| 42 |
base_model: timm/mobilenetv4_conv_small.e2400_r224_in1k
|
|
|
|
| 62 |
|
| 63 |
MobileNetV4-conv-small, 2.5M parameters, 10 MB ONNX file. Greyscale page squashed to 640 × 640. 33 ms per page on one CPU thread, 12 ms on four (model only).
|
| 64 |
|
| 65 |
+
Trained on Hugging Face Jobs: one A10G, about 23 minutes per run. Details are under [Training](#training).
|
| 66 |
+
|
| 67 |
+
> **Check the thresholds on your own pages.** The default cut-offs (0.55 for a script, 0.627 for "unknown") were chosen on web PDFs and do not carry over unchanged. The same rule returns "unknown" for 5% of web-PDF pages, 11.5% of government documents and half of photographed pages. Before you filter or route on the decision, run the model on a few hundred of your own pages, look at the probabilities, and set the cut-offs there.
|
| 68 |
+
|
| 69 |
Scripts: Arabic, Armenian, Bengali, Cyrillic, Devanagari, Ethiopic, Georgian, Greek, Gujarati, Han, Hangul, Hebrew, Japanese, Kannada, Khmer, Latin, Malayalam, Myanmar, Tamil, Telugu, Thai.
|
| 70 |
|
| 71 |
## Quick start
|
|
|
|
| 128 |
- **Several scripts:** two or more at or above it, usually a mixed page.
|
| 129 |
- **No text:** not an output of this model. Blank pages usually come out "unknown", but not always. Take "no text" from a separate no-text model, such as the `no_text` output of [page-ocr-flags](https://huggingface.co/small-models-for-glam/page-ocr-flags).
|
| 130 |
|
| 131 |
+
0.627 is the value at which 95% of 2,071 validation pages are still answered; the temperature was fitted on the same pages. Both thresholds are in `config.json`: change them there once you have checked them on your own pages.
|
| 132 |
|
| 133 |
**Why 0.55 for the script threshold.** It is the value chosen on the validation pages for this checkpoint. A lower value finds more mixed pages but gives more single-script pages a spurious second script. Computed for this card from the saved predictions on the 2,056 web-PDF test pages (unknown 5.3% in both cases):
|
| 134 |
|