page-script-id / config.json
davanstrien's picture
davanstrien HF Staff
Upload page-script-id-v2 (distilled MobileNetV4-Small 640px, FP32 ONNX + timm + card)
b9c06e5 verified
Raw History Blame Contribute Delete
3.34 kB
{
"architecture": "mobilenetv4_conv_small",
"num_classes": 21,
"label_names": [
"Arab",
"Beng",
"Cyrl",
"Deva",
"Grek",
"Hang",
"Hani",
"Hebr",
"Jpan",
"Latn",
"Taml",
"Thai",
"Armn",
"Ethi",
"Geor",
"Gujr",
"Khmr",
"Knda",
"Mlym",
"Mymr",
"Telu"
],
"model_args": {
"num_classes": 21,
"in_chans": 3
},
"pretrained_cfg": {
"custom_load": false,
"input_size": [
3,
640,
640
],
"test_input_size": [
3,
640,
640
],
"fixed_input_size": false,
"interpolation": "bilinear",
"crop_pct": 1.0,
"test_crop_pct": 1.0,
"crop_mode": "squash",
"mean": [
0.485,
0.456,
0.406
],
"std": [
0.229,
0.224,
0.225
],
"num_classes": 21,
"license": "apache-2.0",
"label_names": [
"Arab",
"Beng",
"Cyrl",
"Deva",
"Grek",
"Hang",
"Hani",
"Hebr",
"Jpan",
"Latn",
"Taml",
"Thai",
"Armn",
"Ethi",
"Geor",
"Gujr",
"Khmr",
"Knda",
"Mlym",
"Mymr",
"Telu"
]
},
"inference": {
"onnx_file": "model.onnx",
"onnx_input_name": "grey",
"onnx_output_name": "probabilities",
"input_size": 640,
"temperature": 1.15,
"scripts": [
"Arab",
"Beng",
"Cyrl",
"Deva",
"Grek",
"Hang",
"Hani",
"Hebr",
"Jpan",
"Latn",
"Taml",
"Thai",
"Armn",
"Ethi",
"Geor",
"Gujr",
"Khmr",
"Knda",
"Mlym",
"Mymr",
"Telu"
],
"script_names": {
"Arab": "Arabic",
"Beng": "Bengali",
"Cyrl": "Cyrillic",
"Deva": "Devanagari",
"Grek": "Greek",
"Hang": "Hangul",
"Hani": "Han",
"Hebr": "Hebrew",
"Jpan": "Japanese",
"Latn": "Latin",
"Taml": "Tamil",
"Thai": "Thai",
"Armn": "Armenian",
"Ethi": "Ethiopic",
"Geor": "Georgian",
"Gujr": "Gujarati",
"Khmr": "Khmer",
"Knda": "Kannada",
"Mlym": "Malayalam",
"Mymr": "Myanmar",
"Telu": "Telugu"
},
"unknown_threshold": 0.7038,
"script_threshold": 0.55,
"mixed_page_threshold": 0.5,
"colour": "greyscale page",
"resize": "bilinear squash to 640 x 640 (aspect ratio not kept, no crop, no padding); for wide text-block crops, pad to a white square before resizing",
"jpeg_draft": "for JPEG input, decode at reduced scale with PIL draft(L, (1280, 1280)) before the resize, as in training",
"onnx_input": "float32, N x 640 x 640, grey values 0 to 255; normalisation, temperature and sigmoid are inside the ONNX graph; output N x 21 probabilities",
"timm_input": "float32, N x 3 x 640 x 640: grey / 255 copied to three channels, then (x - mean) / std with the pretrained_cfg mean and std; output N x 21 logits",
"probability": "timm: sigmoid(logit / 1.15) per script (the ONNX file already returns this)",
"rule": "if the largest probability is below unknown_threshold, the page is unknown; otherwise report every script with probability >= script_threshold (or mixed_page_threshold=0.50 when finding mixed-script pages matters more than a clean single answer)."
}
}