New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add watched_plate arg #27
Comments
The api returns the most likely plate, but also other candidate plates, and these can be matched against also:
The following function returns all candidate plates, could just match on this: from typing import List, Dict
def get_plates(results : List[Dict]) -> List[str]:
"""
Return the list of candidate plates.
If no plates empty list returned.
"""
plates = []
candidates = [result['candidates'] for result in results]
for candidate in candidates:
cand_plates = [cand['plate'] for cand in candidate]
for plate in cand_plates:
plates.append(plate)
return list(set(plates))
get_plates(response.json()['results'])
... ['kfa8726', 'kfa8725', 'kfab725', 'kfab726'] Could also count the number of letters that must exist in any detected plate, this could also be an arg? Too complicated |
Merged
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parallels robmarkcole/HASS-Sighthound#22
Add a watched_plate arg that is a list of plates to watch for, allowing fuzzy matching. I.e. a matched plate will be detected when there is a good match of characters using regex. For each plate an attribute is exposed which is a binary sensor indicating if the plate was in the last scanned imaged or not. Add a
watched_plate
event as well?The text was updated successfully, but these errors were encountered: