Polili OCR Precision

Technical guide to how the Polili on-screen OCR translator scales, filters, and recognizes Chinese subtitle characters — and how to configure your setup for maximum accuracy.

The OCR engine: PaddleOCR PP-OCRv3

Polili uses PaddleOCR PP-OCRv3, Baidu's third-generation lightweight recognition model, compiled to ONNX format and run entirely inside the browser via ONNX Runtime Web (WASM). The model is downloaded once (~10 MB), cached in IndexedDB, and runs fully offline — no images are ever sent to a server.

PP-OCRv3 uses a CTC (Connectionist Temporal Classification) decoder against a 6,625-character dictionary covering simplified Chinese, traditional Chinese, punctuation, digits, and Latin letters. It substantially outperforms Tesseract on Chinese subtitle fonts because it was specifically trained on text-in-the-wild image data rather than document scans.

The full preprocessing pipeline

Before any image reaches the neural network, Polili applies five transformation stages to maximize character visibility:

1

Capture & crop

The browser draws the current video frame onto an OffscreenCanvas cropped to the user-defined subtitle strip. Only the strip is processed — never the full frame. A 3% horizontal edge trim removes corner watermarks and streaming logos that would otherwise confuse the model.

2

Resolution upscaling

If the cropped strip is shorter than 60 pixels vertically, Polili scales it up (up to 3×) so the character height reaches the model's optimal input range. The output width is capped at 1800 px to avoid memory pressure.

3

White-pixel isolation

Movie subtitles are almost universally white or yellow on a dark background. Polili applies a two-branch filter: pixels with luminance > 210 and low color saturation (white/grey) are rendered black. Bright yellow pixels (Taiwanese/HK-style subtitles: R > 200, G > 190, B < 40) are also rendered black. All other pixels become white. The result is clean black-on-white text that the CTC decoder reads with high confidence.

4

Density gating

After isolation, Polili counts the fraction of black pixels in the strip (the "density"). If density is below 0.4% — no text present — the frame is skipped. If above 8% — bright scene flash or title card — the frame is also skipped. Real dialog subtitles consistently fall between 0.4% and 7%.

5

Horizontal auto-crop

Inside the offscreen OCR document, Polili finds the leftmost and rightmost columns containing any black pixel and crops the image to that span (plus half-height padding). This removes blank whitespace that would cause the CTC decoder to hallucinate characters in empty regions.

Resolution requirements and accuracy table

The single biggest factor in OCR accuracy is the rendered height of the subtitle characters in pixels. Characters must be tall enough for the model to distinguish between visually similar glyphs (e.g., 己/已/巳, 土/士, 末/未).

Video quality Approx. char height Expected accuracy Verdict
1080p32–40 px 98–99% on standard subtitle fonts Excellent
720p22–28 px 94–97% Recommended minimum
480p14–18 px 80–88% — some characters confused Acceptable
360p10–13 px 60–75% — frequent errors on complex chars Not recommended

The upscaling step (pipeline stage 2) partially compensates for low resolution, but cannot recover detail that was never captured. Set your video player to 720p or higher before starting Polili for best results.

Common recognition errors and built-in corrections

The PP-OCRv3 model has a small set of systematic confusions on specific character pairs. Polili applies two correction layers after decoding:

Single-character substitution table

Applied to any character matching the key, regardless of context:

Phrase-level corrections

Applied to bigrams/trigrams where the wrong string is never valid Chinese:

These corrections are updated in each release. If you encounter a systematic error not listed above, email feedback@polili.app with a screenshot and the video URL — confirmed errors are patched within two weeks.

Similarity deduplication — why some subtitles are skipped

Polili samples the subtitle strip every 250 ms. If the new OCR result is very similar to the previous one (same subtitle still on screen), rendering it again would cause the pinyin overlay to flicker. Polili uses a character-bag similarity score:

The lower threshold for longer subtitles allows Polili to catch lines that reuse common characters (你/我/了/快…) but differ in meaning — lines that a naive character-counting approach would incorrectly suppress.

Placement tips for maximum accuracy

  1. Use "Draw custom" for tight placement. The teal suggestion box is a starting point. Clicking "Draw custom" lets you draw a pixel-precise box. The tighter the box, the fewer background pixels enter the density filter — reducing false positives from bright scenes.
  2. Exclude the English translation line. Many C-drama and K-drama files include an English translation below the Chinese. If your box captures both, the OCR sees double the character count, which can push the density above the 8% ceiling and cause the frame to be skipped.
  3. Use the ✂ Snip tool for stylized fonts. Period dramas occasionally use calligraphic or decorative title fonts that fall outside the model's training distribution. Snip lets you manually OCR any specific character and get its per-character definition from CC-CEDICT.
  4. Re-mark after seeking. The subtitle strip position is stored as a ratio of the video element's size. If the video player changes layout (e.g., toggling theater mode), click "Re-mark" to realign the strip.
Advanced use: the Polili panel's D-pad controls adjust the pinyin overlay position (±2 px per click vertically, ±4 px horizontally). Use A+ / A− to scale the font size and +/− to widen the per-character spacing to match the subtitle's character width. These values persist across sessions for each browser tab.