/tabcellscore

a library for evaluating cell detection f1 score.

Primary LanguagePython

TABLE CELL SCORE

License Python 3.7

Description

This package give a metric to evaluate table cell detection based on table cell bounding boxes.

Installation

You can install the package using pip:

pip install tabcell_score

Usage

Input format: We follow the format of the json label file from labelme.

{
    "shapes":[
        "label": "cell",
        "points": [
            [
                0.,
                0.,
            ],
            [
                13.,
                13.
            ]
        ]
    ]
}

In code use:

from tabcell_score import TabCellScore

# Specify the label and image path
gt_path = r"sample\gt.json"
pred_path = r"sample\pred.json"
img_path = r"sample\image.jpg"

tabcellscore = TabCellScore(iou_threshold = 0.95)

# Output score only
score = tabcellscore(gt_path, pred_path) 

# Output score and visualize on image and save to "result.jpg"
score = tabcellscore(gt_path, pred_path, img_path, "result.jpg") 

# Output score and visualize on empty image and save to "result.jpg"
score = tabcellscore(gt_path, pred_path, None, "result.jpg")

print(score)

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

"Hope this package could help you in table cell evaluation." Phạm Phú Ngọc Trai (from akaOCR).