Skip to content
Ming Xu (徐明) edited this page Dec 18, 2024 · 2 revisions

Welcome to the imgocr wiki!

Usage

pip install imgocr -U

import time
import sys

sys.path.append('..')
from imgocr import ImgOcr
from imgocr import drwa_ocr_boxes

if __name__ == "__main__":
    m = ImgOcr()
    img_path = "data/11.jpg"
    s = time.time()
    result = m.ocr(img_path)
    e = time.time()
    print("total time: {:.4f} s".format(e - s))
    print("result:", result)
    for line in result[0]:
        print(line)

    # draw boxes
    drwa_ocr_boxes(img_path, result, '11_box.jpg')
    print('Save result to 11_box.jpg')

Clone this wiki locally