Skip to main content

Table extraction from image.

Project description

TableCV

Extract table from an image.

Usage

There are two ways to get table from an image.

Approach 1 (uses PaddleOCR)

Call extract_table (returns pandas Dataframe object).

from tablecv import extract_table

print(extract_table(image_path=""))

Approach 2

Perform ocr using your favourite OCR tool (EasyOCR, KerasOCR, PaddleOCR, WhateverOCR ...).

ocr_results object should look like the following:

# list of tuple of bounding box and text

ocr_results = [
    (
        (1, 2, 3, 4), "a"   # (x, y, w, h), text
    ),
    (
        (4, 5, 6, 7), "b"
    ),
    ...
]

and then call extract_table_from_ocr method.

from tablecv import extract_table_from_ocr

ocr_results: list[tuple[tuple[float, float, float, float], str]] = ...
print(extract_table_from_ocr(ocr_results))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tablecv-0.1.0.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

tablecv-0.1.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page