Polygons (Bounding Boxes)

Add the polygon coordinates of each extracted field to the API response.

bounding-box polygons displayed in the Live Interface

Overview

The polygons parameter, also commonly referred to as bounding boxes, is a feature you can enable in your Models. It indicates the precise polygonal area on the document where the value for each extracted field was detected.

  • These polygons define the exact location on the document containing the extracted data.

  • They enable visual verification by highlighting where the model found each value on the document.

  • This feature is especially useful for building user interfaces that overlay extracted data on document images for validation or review.

How It Works

  • A polygon (bounding box) is an array of points outlining a closed shape around the detected data area.

  • Points are given as normalized coordinates relative to the document page dimensions:

    • Each coordinate is a float between 0 and 1.

    • (0, 0) corresponds to the top-left corner; (1, 1) corresponds to the bottom-right corner.

  • Multiple polygons can be returned if there are several extracted fields or data areas.

Activate Polygons

This feature is not available on all plans, check the Feature Comparison section for more information.

Activate Polygons on the Platform

Activate Polygons via API Calls

Check the Optional Features Configuration section if using our Client Libraries / SDKs.

Otherwise take a look at the POST /v2/inferences/enqueue section.

Use the Polygon Result

We highly recommend using our Client Libraries / SDKs, as they include various geometry functions for ease of processing.

Specifically for handling polygons, take a look at the locations section.

Otherwise, take a look at the GET /v2/inferences/{inference_id} section.

Some Use Cases

  • Visual validation by overlaying bounding boxes on document previews for users to confirm extraction accuracy.

  • Debugging extraction quality by analyzing detected regions.

  • Enhancing UI with highlighted fields for better user experience.

Last updated

Was this helpful?