Skip to content

Instantly share code, notes, and snippets.

@danleyb2
Created June 14, 2022 08:26
Show Gist options
  • Select an option

  • Save danleyb2/2f5c5c13cb187d1e01023a1ee9f3e991 to your computer and use it in GitHub Desktop.

Select an option

Save danleyb2/2f5c5c13cb187d1e01023a1ee9f3e991 to your computer and use it in GitHub Desktop.

Revisions

  1. danleyb2 created this gist Jun 14, 2022.
    28 changes: 28 additions & 0 deletions detection_mode_vehicle.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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)