StagesDetect

PaddleTextDetector

The detection half of a PaddleOCR preset — line-level boxes, no text.

Import
import { PaddleTextDetector } from '@stabrise/scaledp/ocr'
Group
Detect
Reads
image
Writes
boxes
Needs
ppu-paddle-ocr

Runs only the detection model of a PaddleOCR preset. Use it when you want boxes without paying for recognition, or to feed a different recognizer.

import { Pipeline } from '@stabrise/scaledp'
import { PdfToImage } from '@stabrise/scaledp/pdf'
import { PaddleTextDetector, TesseractRecognizer } from '@stabrise/scaledp/ocr'

const rows = await new Pipeline([
    new PdfToImage(),
    new PaddleTextDetector({ outputCol: 'boxes' }),
    new TesseractRecognizer({ inputCols: ['image', 'boxes'] }),
]).transform(file)
Open in builder

Regions are line-level — one box per line of text, as in Python ScaleDP. Boxes are axis-aligned with score: 1; the confidence a recognizer produces is a separate thing. DetectorOutput.type is 'paddle'.

PaddleTextRecognizer detects and recognises in a single pass and ignores any separate detector's boxes. Running both is how you compare what a detector finds against what the recognizer acted on — it is not a way to feed one into the other. For that, use PaddleRecognizer or TesseractRecognizer.

The input may be a ScaleDpImage, an OffscreenCanvas or ImageData. An unknown preset throws RangeError from the constructor; see the preset list.

Parameters

ParameterTypeDefaultMeaning
preset'v6-small' | 'v6-medium' | 'v6-tiny' | 'v5-latin-mobile' | … (14 total)'v6-small'Language/script pairing. Detection and recognition share the download.
scoreThresholdnumber 0–10Drop regions below this confidence. 0 keeps everything.

On this page