[Python] Paddle OCR not able to extract single digits from image

Discussão em 'Python' iniciado por Stack, Maio 15, 2025.

  1. Stack

    Stack Membro Participativo

    I am doing an image OCR using Paddle OCR. Below is the sample code I am using:

    from paddleocr import PaddleOCR
    import os

    image_file = "3_496.png"

    ocr = PaddleOCR(use_gpu=True)
    image_path = os.path.join(os.getcwd(), image_file)
    result = ocr.ocr(image_path, cls=True)

    if None not in result:
    print(f"OCR result for {image_file}:")
    for line in result[0]:
    print(line[1][0])


    Below is the image file:

    [​IMG]

    In this image, Paddle OCR is able to extract almost all the items but failed in extracting 4 (PACK SIZE). I have some more very similar images and have noticed that it fails in extracting single digits. Is it true or may be I am doing something wrong?

    Below is the output after running the above code:

    OCR result for 3_496.png: PAGLNILE. PIGRWGIGHT 400g DATCHNUMHERE USLOYI 205257 31/07/2024 12.22. CUTIN NZ

    Continue reading...

Compartilhe esta Página