---
comments: true
---
# Text Detection Module Usage Guide
## 1. Overview
The text detection module is a critical component of OCR (Optical Character Recognition) systems, responsible for locating and marking text-containing regions in images. The performance of this module directly impacts the accuracy and efficiency of the entire OCR system. The text detection module typically outputs bounding boxes for text regions, which are then passed to the text recognition module for further processing.
## 2. Supported Models List
Parameter |
Description |
Type |
Options |
Default |
model_name |
Model name |
str |
All PaddleX-supported text detection model names |
Required |
model_dir |
Model storage path |
str |
N/A |
N/A |
device |
Inference device |
str |
GPU (e.g., "gpu:0"), NPU (e.g., "npu:0"), CPU ("cpu") |
gpu:0 |
limit_side_len |
Image side length limit for detection |
int/None |
Positive integer or None (uses default model config) |
None |
limit_type |
Side length restriction type |
str/None |
"min" (shortest side ≥ limit) or "max" (longest side ≤ limit) |
None |
thresh |
Pixel score threshold for text detection |
float/None |
Positive float or None (uses default model config) |
None |
box_thresh |
Average score threshold for text regions |
float/None |
Positive float or None (uses default model config) |
None |
unclip_ratio |
Expansion coefficient for Vatti clipping algorithm |
float/None |
Positive float or None (uses default model config) |
None |
use_hpip |
Enable high-performance inference plugin |
bool |
N/A |
False |
hpi_config |
High-performance inference configuration |
dict | None |
N/A |
None |
* The `predict()` method parameters:
Parameter |
Description |
Type |
Options |
Default |
input |
Input data (image path, URL, directory, or list) |
Python Var /str /dict /list |
Numpy array, file path, URL, directory, or list of these |
Required |
batch_size |
Batch size |
int |
Positive integer |
1 |
limit_side_len |
Image side length limit for detection |
int/None |
Positive integer or None (uses model default) |
None |
limit_type |
Side length restriction type |
str/None |
"min" or "max" |
None |
thresh |
Pixel score threshold for text detection |
float/None |
Positive float or None (uses model default) |
None |
box_thresh |
Average score threshold for text regions |
float/None |
Positive float or None (uses model default) |
None |
unclip_ratio |
Expansion coefficient for Vatti clipping algorithm |
float/None |
Positive float or None (uses model default) |
None |
* Result processing methods: