comic-text-and-bubble-detector (int8, Conv-only static quantization)
This repository contains an int8 version of the speech bubble and text detector ogkalu/comic-text-and-bubble-detector. The ToonLens Android app (comic translation) downloads this file for its "precise detection" mode.
Notice of modification (Apache-2.0, Section 4(b))
This file is a modified version of the original work.
- Original work:
detector.onnxfrom ogkalu/comic-text-and-bubble-detector, revision16e8a622f91fabc6b5b65c96d32d1183f8843546(168,481,531 bytes, SHA256065744e91c0594ad8663aa8b870ce3fb27222942eded5a3cc388ce23421bd195). - Original author: ogkalu. Original license: Apache-2.0.
- Change: Team.R quantized the
Convoperators to int8 (2026-10-26). All other operators (including theMatMuloperators of the transformer decoder) stay in fp32. The model architecture, the inputs and the outputs did not change. - Team.R did not train or fine-tune the model.
File
| File | Size | SHA256 |
|---|---|---|
detector_rtdetr_int8c.onnx |
67,055,821 bytes | d501da38f5faeac2c4fbfd5ea33f9f0b24471b22400d4c9f6bae307e7733d5a4 |
Quantization method
| Item | Value |
|---|---|
| Tool | ONNX Runtime 1.30, onnxruntime.quantization |
| Pre-processing | quant_pre_process(..., skip_symbolic_shape=True) |
| Method | quantize_static, QuantFormat.QDQ |
| Operators | op_types_to_quantize=["Conv"] only |
| Types | activations QUInt8, weights QInt8, per_channel=True |
| Calibration data | 21 synthetic comic images made by Team.R (the first 3 images of each sample set). No third-party images. |
When Team.R also quantized the MatMul operators, the scores of small speech bubbles became lower.
For this reason, the MatMul operators stay in fp32.
Inputs and outputs
The inputs and outputs are the same as in the original model.
| Name | Type | Shape | Meaning |
|---|---|---|---|
input images |
float32 | Nร3ร640ร640 | RGB, values 0โ1 (pixel / 255). The app resizes the full page to 640ร640 (bilinear, no letterbox). |
input orig_target_sizes |
int64 | Nร2 | Original [width, height] of each image |
output labels |
int64 | Nร300 | Class ID: 0 bubble, 1 text_bubble, 2 text_free |
output boxes |
float32 | Nร300ร4 | [x0, y0, x1, y1] in pixels of the original image |
output scores |
float32 | Nร300 | Confidence, 0โ1 |
The ToonLens app keeps the boxes with a score of 0.3 or more and class 1 or 2. Then the app removes overlapping boxes.
Measured results (Team.R, for reference)
| Model | Size | PC time (i5-1335U, 4 threads) | Galaxy Z Fold7 detection time | Dialogue boxes found (65 test images) |
|---|---|---|---|---|
| Original fp32 | 168.5 MB | 837 ms | 1944 ms | 369 of 373 |
| This int8 file | 67.1 MB | 455 ms | 802 ms | 369 of 373 |
The test images are 50 synthetic images and 15 real comic pages. Team.R did not use these 15 pages for calibration.
Use in the ToonLens app
- The app downloads this file only when the user turns on "precise detection".
- The app checks the size and the SHA256 of the file before it uses the file.
- The app shows the Apache-2.0 notice and this modification notice on its information screen.
License
Apache License 2.0. See LICENSE. The original work is also under Apache-2.0: ogkalu/comic-text-and-bubble-detector.
Model tree for depreciation84/comic-text-and-bubble-detector-int8
Base model
ogkalu/comic-text-and-bubble-detector