Skip to main content
POST
/
detection
Perform text detection
curl --request POST \
  --url https://ocr-api.trace.so/detection/ \
  --header 'Content-Type: multipart/form-data' \
  --form 'files=<string>' \
  --form files.items='@example-file'
[
  {
    "name": "<string>",
    "bounding_boxes": [
      [
        123
      ]
    ]
  }
]

Query Parameters

detection_model
string
default:db_resnet50

Detection architecture to use. See the models page for available options.

assume_straight_pages
boolean
default:true

Return axis-aligned bounding boxes. Set to false for rotated documents to get 4-point polygons instead.

preserve_aspect_ratio
boolean
default:true

Pad the image to preserve its aspect ratio before feeding it to the model.

symmetric_padding
boolean
default:true

Pad symmetrically (centered) rather than bottom-right only.

detection_batch_size
integer
default:2

Number of pages processed in parallel during detection. Increase for multi-page PDFs if you have enough memory.

binary_threshold
number
default:0.1

Pixel-level threshold for the detection segmentation heatmap. Lower values detect more text but may introduce false positives.

box_threshold
number
default:0.1

Minimum confidence score to keep a detected bounding box. Lower values return more boxes but may include noise.

Body

multipart/form-data
files
file[]

One or more files to process. Accepts JPEG, PNG, and PDF formats.

Response

Successful Response

name
string
required
Example:

"example.jpg"

bounding_boxes
number[][]
required
Example:
[0, 0, 0, 0]