Skip to main content

Python Package to read labels from image

Project description

PyReadLabels

A Python Package to read labels from an image

USAGE

from PyReadLabels import pyreadlabels

To return a dictionary with the following keys: lines

result = pyreadlabels.detect( "path_to_image" )
print( result["lines"] )

To return a dictionary with the following keys: lines, image, pos

result = pyreadlabels.detect( "path_to_image", conf=0.25, get_positions=True, x_line=0.2, y_line=0.1, return_image=True )
print( result )

conf - confidence score above which the label characters are considered.
x_line - the percentage difference between x coordinates above which a new line starts.
y_line - the percentage difference between x coordinates above which a new line starts.
get_positions - Boolean Value, True returns a "pos" key which contains boxes (absolute x,y,w,h values), correspondind labels, and confidences
return_image - Boolean Value, True Returns a "image" key which can be used to display image.

import cv2
cv2.imshow( "result", result["image"] )
cv2.waitKey(0)
cv2.destroyAllWindows()

Project details


Download files

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

Files for PyReadLabels, version 1.1.5
Filename, size File type Python version Upload date Hashes
Filename, size PyReadLabels-1.1.5-py3-none-any.whl (32.2 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size PyReadLabels-1.1.5.tar.gz (32.2 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page