Table Transformer

TABLE_TRANSFORMER

Reads the structure of a table in an image, finding its rows, columns, column headers, projected row headers and spanning cells, with a box and a score for each.

Vision & Analysisobject-detectiontable-structuredocumentsmitFine-tunable
Table Transformer: Vision & Analysis model on Kainguru

About Table Transformer

Capabilities

  • Table structure — rows, columns, column headers, projected row headers and spanning cells, each as a box with a score
  • Cells from boxes — where a row's box meets a column's box is a cell: crop it and read it with OCR
  • Fine-tunable — train it on your own tables, with its six labels or a label set of your own

Good to know

  • Send one table cropped from its page: the model reads the structure of a single table. To find the tables on a page first, use DOCLING_LAYOUT_HERON and crop its table boxes.
  • It returns boxes, not text: read each cell's text with an OCR model.
  • Its labels are table, table column, table row, table column header, table projected row header and table spanning cell.
  • It was trained on scientific and financial tables (PubTables-1M and FinTabNet); check it on your own documents.
  • Images must be PNG, JPEG or WebP, at most 20 MB and 40 megapixels; boxes are in pixels of the image you send.
  • Fine-tuning takes your images and a JSONL manifest with one {"file", "boxes", "labels"} line per image. Training with only the model's own labels keeps them; any other label gives a model that knows exactly your labels.
  • A fine-tuning dataset is 4 to 1,000 images, each PNG, JPEG or WebP of at most 20 MB and 40 megapixels, and 4 GB in all, with up to 100 boxes per image and 100 different labels of up to 64 characters.

Table Transformer inputs and output

NameTypeRequiredDefaultDetails
imagefileYes—The picture to search: PNG, JPEG or WebP, up to 20 MB and 40 megapixels.
1–2048 characters · image/png, jpeg, webp
thresholdnumberNo—Lowest score to return, 0 to 1; higher returns fewer, surer boxes. Empty uses the model's recommended value.
0–1

Output. JSON array, best first: [{"label": "...", "score": 0.87, "box": [x0, y0, x1, y1]}, ...], box corners in pixels of the image, at most 300 boxes.

Run Table Transformer with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=TABLE_TRANSFORMER" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.png"
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "TABLE_TRANSFORMER",
        {
          "image": "https://example.com/input.png"
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune Table Transformer

You can fine-tune Table Transformer on your own data and run the tuned model through the same API. Dataset: Images plus a JSONL manifest, one {"file", "boxes", "labels"} per image: file as its upload returned it, boxes [[x0, y0, x1, y1], ...] in pixels, a label per box. 4 to 1000 images, 100 boxes each, 100 labels of up to 64 characters.

The steps are in the docs.

Table Transformer pricing

Price per request: 0.0437 credits ($0.000437). The price is shown again before every run; all prices are on the pricing page.

Licence and source

Florence-2 Large: Vision & Analysis model on Kainguru
Vision & Analysis

Florence-2 Large

One small vision model that captions images, reads text, boxes objects and finds things named by a phrase.

Fine-tunable
Docling Layout Heron: Vision & Analysis model on Kainguru
Vision & Analysis

Docling Layout Heron

Finds the layout of a document page, such as text blocks, titles, section headers, tables, pictures, captions…

Fine-tunable
BLIP2 Flan T5 XL: Vision & Analysis model on Kainguru
Vision & Analysis

BLIP2 Flan T5 XL

Describes a photo in a sentence or answers a question about it in plain English.

Fine-tunable
GLM-OCR: Vision & Analysis model on Kainguru
Vision & Analysis

GLM-OCR

GLM-OCR reads documents in pictures: it writes out the text of a page, tables as HTML and formulas as LaTeX, and can…

Fine-tunable
Grounding DINO Base: Vision & Analysis model on Kainguru
Vision & Analysis

Grounding DINO Base

Finds the things you name in a picture, such as "red car, person with a helmet", and returns a box around each one.

Fine-tunable
Moondream 2: Vision & Analysis model on Kainguru
Vision & Analysis

Moondream 2

Moondream 2 is a small vision model: it answers questions about a picture, writes short, normal or long captions and…

Fine-tunable