Upload 9 files
Browse filesFiles changed (10)
- .gitattributes+1
- README.mdAdded+55
- config.jsonAdded+72
- glm_ocr_decoder.onnxAdded+3
- glm_ocr_decoder_int8.onnxAdded+3
- glm_ocr_vision.onnxAdded+3
- glm_ocr_vision.onnx.dataAdded+3
- glm_ocr_vision_int8.onnxAdded+3
- manifest.jsonAdded+30
- tokenizer.jsonAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textglm_ocr_vision.onnx.data filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455---
language:
- en
- zh
license: apache-2.0
tags:
- onnx
- ocr
- multimodal
- glm
- document-intelligence
- agriculture
- precision-farming
- farmerstoday
base_model: zai-org/GLM-OCR
pipeline_tag: image-to-text
---
# FarmersToday GLM-OCR (ONNX Optimized)
Official ONNX release of **GLM-OCR** tailored for agricultural document understanding, statutory chemical container labels, weighbridge grain scale tickets, veterinary prescriptions, soil fertility laboratory reports, and supply-chain logistics delivery invoices.
Converted and quantized by the **FarmersToday Open AgTech Initiative** from upstream [zai-org/GLM-OCR](https://huggingface.co/zai-org/GLM-OCR).
## Model Architecture
- **Vision Backbone**: CogViT Visual Transformer (`glm_ocr_vision.onnx` / `glm_ocr_vision_int8.onnx`), 896x896 input resolution.
- **Language Decoder**: GLM-0.5B Autoregressive Transformer (`glm_ocr_decoder.onnx` / `glm_ocr_decoder_int8.onnx`).
- **Precision**: Full Precision (FP32) and Dynamic Quantized (INT8) for edge farm servers and mobile field tablets.
## Key Capabilities & Supported Documents
1. **Agrochemical Container Labels**:
- Regulatory Registration Numbers (EPA, PCP, BVL, MAPA)
- Active Ingredients & Formulations (e.g. Chlorothalonil 720 SC)
- Statutory Pre-Harvest Interval (PHI) & Worker Re-Entry Interval (REI)
- Buffer Zones for Waterways & Sensitive Habitats
2. **Weighbridge Grain Scale Tickets**:
- Gross, Tare, and Net Metric Weights
- Moisture %, Test Weight (kg/hL), Protein %, Foreign Matter %
- Vehicle License & Silo Bin Routing
3. **Veterinary Prescriptions**:
- Livestock Ear Tag IDs, Herd Cohorts
- Active Pharmaceuticals, Dosage Rates, Milk & Meat Withdrawal Days
4. **Soil & Tissue Laboratory Reports**:
- pH, Organic Matter (SOM %), CEC
- Macro/Micro Nutrients (N, P, K, Ca, Mg, S, Zn, B)
5. **Vendor Invoices & Delivery Dockets**:
- Chemical/Fertilizer/Seed itemized line tables, batch codes, tax breakdowns.
## Accompanying Models in the FarmersToday Suite
- Crop Disease Pathology: [`farmerstoday/plant-disease-recognition-onnx`](https://huggingface.co/farmerstoday/plant-disease-recognition-onnx)
- Weed Leaf Segmentation: [`farmerstoday/weed-segmentation-yolov8-onnx`](https://huggingface.co/farmerstoday/weed-segmentation-yolov8-onnx)
- Livestock Body Condition: [`farmerstoday/livestock-bcs-onnx`](https://huggingface.co/farmerstoday/livestock-bcs-onnx)
## License
Apache 2.0 (Inherited from upstream GLM-OCR).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172{ "architectures": [ "GlmOcrForConditionalGeneration" ], "image_end_token_id": 59257, "image_start_token_id": 59256, "image_token_id": 59280, "model_type": "glm_ocr", "text_config": { "attention_bias": false, "attention_dropout": 0.0, "dtype": "bfloat16", "eos_token_id": [ 59246, 59253 ], "head_dim": 128, "hidden_act": "silu", "hidden_size": 1536, "initializer_range": 0.02, "intermediate_size": 4608, "max_position_embeddings": 131072, "model_type": "glm_ocr_text", "num_attention_heads": 16, "num_hidden_layers": 16, "num_key_value_heads": 8, "num_nextn_predict_layers": 1, "pad_token_id": 59246, "rms_norm_eps": 1e-05, "rope_parameters": { "mrope_section": [ 16, 24, 24 ], "partial_rotary_factor": 1.0, "rope_theta": 10000, "rope_type": "default" }, "tie_word_embeddings": false, "use_cache": true, "vocab_size": 59392 }, "tie_word_embeddings": false, "transformers_version": "5.17.0", "video_end_token_id": 59259, "video_start_token_id": 59258, "video_token_id": 59281, "vision_config": { "attention_bias": true, "attention_dropout": 0.0, "depth": 24, "hidden_act": "silu", "hidden_dropout_prob": 0.0, "hidden_size": 1024, "image_size": 336, "in_channels": 3, "initializer_range": 0.02, "intermediate_size": 4096, "model_type": "glm_ocr_vision", "num_heads": 16, "out_hidden_size": 1536, "patch_size": 14, "rms_norm_eps": 1e-05, "rope_parameters": { "rope_theta": 10000.0, "rope_type": "axial" }, "spatial_merge_size": 2, "temporal_patch_size": 2 }}123version https://git-lfs.github.com/spec/v1oid sha256:548fe3d0898c2950802c75c1932dc2163e6de5843906c6495484b4ce325f7d32size 777028648123version https://git-lfs.github.com/spec/v1oid sha256:3ff74f6f75248495ca0010cb340ec6cecdf1d01523d4150567aee3a055c01448size 194288180123version https://git-lfs.github.com/spec/v1oid sha256:39df103fb48f23e053385aa89013b159378d6640b30183ef933df472657784ccsize 25524536123version https://git-lfs.github.com/spec/v1oid sha256:a9e8cdab5967a8ad14df1fe3c5fb94778715a879cee0e65db370f7c7777acdb4size 25520128123version https://git-lfs.github.com/spec/v1oid sha256:9ce88e2a88e1663932d7c73a8b14800cb5593b723ab153e13b41a7d5992750bfsize 6423041123456789101112131415161718192021222324252627282930{
"model_id": "zai-org/GLM-OCR",
"target_huggingface_repo": "farmerstoday/glm-ocr-onnx",
"plant_model_reference_repo": "farmerstoday/plant-disease-recognition-onnx",
"architecture": "CogViT-GLM-0.5B Multimodal Encoder-Decoder",
"parameter_count": "0.9B",
"vision_input_shape": [
1,
3,
896,
896
],
"onnx_models": {
"vision_fp32": "glm_ocr_vision.onnx",
"vision_int8": "glm_ocr_vision_int8.onnx",
"decoder_fp32": "glm_ocr_decoder.onnx",
"decoder_int8": "glm_ocr_decoder_int8.onnx"
},
"tokenizer_file": "tokenizer.json",
"config_file": "config.json",
"runtime_status": "READY_FOR_LOCAL_INFERENCE_AND_UPLOAD",
"supported_domains": [
"AGROCHEMICAL_LABEL",
"GRAIN_SCALE_TICKET",
"VETERINARY_PRESCRIPTION",
"SOIL_LAB_REPORT",
"DELIVERY_INVOICE_RECEIPT",
"GENERAL_DOCUMENT"
]
}.gitattributes+1
README.mdAdded+55
config.jsonAdded+72
glm_ocr_decoder.onnxAdded+3
glm_ocr_decoder_int8.onnxAdded+3
glm_ocr_vision.onnxAdded+3
glm_ocr_vision.onnx.dataAdded+3
glm_ocr_vision_int8.onnxAdded+3
manifest.jsonAdded+30
tokenizer.jsonAdded