Skip to content

Instantly share code, notes, and snippets.

@danleyb2
Created June 14, 2022 08:26
Show Gist options
  • Save danleyb2/2f5c5c13cb187d1e01023a1ee9f3e991 to your computer and use it in GitHub Desktop.
Save danleyb2/2f5c5c13cb187d1e01023a1ee9f3e991 to your computer and use it in GitHub Desktop.
import requests
import json
API_TOKEN = '4805bee1222ce85e0bf####################'
regions = ['us-ca', ]
config = dict(
detection_mode='vehicle'
)
c = json.dumps(config)
print(c)
with open('assets/car.jpg', 'rb') as fp:
response = requests.post(
'https://api.platerecognizer.com/v1/plate-reader/',
data=dict(
config=c,
regions=regions,
camera_id='Uphill'
),
files=dict(upload=fp),
headers={'Authorization': 'Token ' + API_TOKEN}
)
print(response)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment