Created
September 21, 2016 01:39
-
-
Save matthill/80c7e0da4e6ea132b94655abbfdff989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openalpr_api | |
from base64 import b64encode | |
apiclient = openalpr_api.DefaultApi() | |
with open("/storage/projects/alpr/samples/testing/car1.jpg", 'r') as img: | |
b64content = b64encode(img.read()) | |
response = apiclient.recognize_post("sk_DEMODEMODEMODEMODEMODEMO", "plate,makemodel,color", image="", image_bytes=b64content, country="us") | |
for plate_obj in response.plate.results: | |
print "Plate: %s - %f percent" % (plate_obj.plate, plate_obj.confidence) | |
print "Color: %s - %f percent" % (response.color[0].value, response.color[0].confidence) | |
print "Make-model: %s - %f percent" % (response.makemodel[0].value, response.makemodel[0].confidence) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment