Skip to content

Instantly share code, notes, and snippets.

@matthill
Created September 21, 2016 01:39
Show Gist options
  • Save matthill/80c7e0da4e6ea132b94655abbfdff989 to your computer and use it in GitHub Desktop.
Save matthill/80c7e0da4e6ea132b94655abbfdff989 to your computer and use it in GitHub Desktop.
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