如何使用Tensorflow OCR训练数据?

问题描述 投票:-2回答:2

我是tensorflow的新手,所以我对tensorflow有点困惑,有多个模型可以执行OCR,如

  1. attention_ocr
  2. 街道

我有下面的文件,我必须执行OCR。我试图使用pytesseract读取图像,但未给出正确的结果。enter image description here

我需要上面图片中的下面结果

  • D MANIKANDAN

  • DURAISAMY

    ] >>
  • 16/07/1986

  • BNZPM2501F

  • 请建议我,张量流模态对于执行以上OCR很有用。我正在使用以下代码从pytesseract

中获取数据
def getData(coordinate, image):
    (y1, y2, x1, x2, classification) = coordinate
    ts = int(time.time())
    height = y2-y1
    width = x2-x1
    crop = image[y1:y1+height, x1:x1+width]
    CROP_IMAGE_URL = EXPORT_PATH +"data.jpg"
    cv2.imwrite(CROP_IMAGE_URL, crop)
    img = cv2.imread(CROP_IMAGE_URL)
    text = pytesseract.image_to_string(img)
    os.remove(CROP_IMAGE_URL)
    return text

我是tensorflow的新手,所以我对tensorflow有点困惑,有多种模型可以执行OCR,例如attention_ocr street,我在下面的文档中必须执行OCR。我尝试使用...

python python-3.x tensorflow tensorflow2.0 tensorflow-datasets
2个回答
1
投票

首先,您必须创建一个对象检测模型来找到插图区域,如图所示。然后,您可以将ROI图像传递到OCR模型或PyTesseract。


1
投票

步骤:

© www.soinside.com 2019 - 2024. All rights reserved.