Python script to export ONNX INT8 inference models for manga OCR and text bubble detection, based on HuggingFace models.
| Model | Size | Input | Output | Source |
|---|---|---|---|---|
encoder.onnx | ~85 MB | pixel_values [1,3,224,224] | last_hidden_state [1,197,768] | manga-ocr-base |
decoder_first.onnx | ~28 MB | input_ids, encoder_hidden_states | logits + 8 KV-cache tensors | " |
decoder_with_past.onnx | ~26 MB | input_ids, encoder_hidden_states, past_0..7 | logits + 8 KV-cache tensors | " |
textdetector.onnx | ~3.2 MB | images [1,3,640,640] | [1,5,8400] (xc,yc,w,h,conf) | manga109-segmentation-bubble (YOLOv11) |
vocab.txt | ~24 KB | — | — | manga-ocr-base tokenizer |
uv venv .venv --python 3.11.3 && source .venv/bin/activate
uv sync
python export.py
Downloads all source models from HuggingFace automatically, exports 4 ONNX models (FP32), quantizes them to INT8, and saves everything to output/.
HuggingFace models (manga-ocr-base + manga109-segmentation-bubble)
-> ONNX export (FP32, opset 14/17)
-> Dynamic quantization INT8
-> output/*.onnx
4 commits
Python
100.0%
Python script to export ONNX INT8 inference models for manga OCR and text bubble detection, based on HuggingFace models.
| Model | Size | Input | Output | Source |
|---|---|---|---|---|
encoder.onnx | ~85 MB | pixel_values [1,3,224,224] | last_hidden_state [1,197,768] | manga-ocr-base |
decoder_first.onnx | ~28 MB | input_ids, encoder_hidden_states | logits + 8 KV-cache tensors | " |
decoder_with_past.onnx | ~26 MB | input_ids, encoder_hidden_states, past_0..7 | logits + 8 KV-cache tensors | " |
textdetector.onnx | ~3.2 MB | images [1,3,640,640] | [1,5,8400] (xc,yc,w,h,conf) | manga109-segmentation-bubble (YOLOv11) |
vocab.txt | ~24 KB | — | — | manga-ocr-base tokenizer |
uv venv .venv --python 3.11.3 && source .venv/bin/activate
uv sync
python export.py
Downloads all source models from HuggingFace automatically, exports 4 ONNX models (FP32), quantizes them to INT8, and saves everything to output/.
HuggingFace models (manga-ocr-base + manga109-segmentation-bubble)
-> ONNX export (FP32, opset 14/17)
-> Dynamic quantization INT8
-> output/*.onnx
4 commits
Python
100.0%