· 6 years ago · Jul 01, 2019, 07:36 PM
1SECRET_KEY = 'sk_1fe86fdb77300b5e46b613cf' #key will be obsolete at some point, you have to ask for your own secret_key on the website of OPEN-ALPR
2COUNTRY = 'us'
3url = 'https://api.openalpr.com/v2/recognize_bytes?recognize_vehicle=0&country=%s&secret_key=%s' % (COUNTRY,SECRET_KEY)
4
5r = requests.post(self.url, self.img_base64)
6output = json.loads(r.text)
7
8if(output["results"]) != [] and output["results"][0]["confidence"] > 90:
9 return output["results"][0]["plate"]