robmarkcole / HASS-plate-recognizer

Read number plates with https://platerecognizer.com/
129 stars 25 forks source link

Implement regions parameter as config arg #8

Closed robmarkcole closed 3 years ago

robmarkcole commented 3 years ago

Implement regions arg

robmarkcole commented 3 years ago

As simple as:

regions = ['gb', 'ie'] # Change to your country
# regions = [None] # also valid

with open("img.jpg", 'rb') as image_bytes:
    response = requests.post(
                              PLATE_READER_URL, 
                              data=dict(regions=regions),  
                              files={"upload": image_bytes}, 
                              headers=headers
              )