Your first plate
From the command line
Section titled “From the command line”Point anpr infer at a photo with a car in it:
anpr infer car.jpgYou get a table with one row per plate the detector found:
| Column | Meaning |
|---|---|
| BBox | Where the plate is in the image, as (x1,y1)-(x2,y2) in pixels. |
| Det conf | How sure the detector is that this is a plate, from 0 to 1. |
| Raw OCR | The characters exactly as the OCR model read them. |
| Plate | The reading after the Turkish format check, such as 34 ABC 1234, or (invalid) if it doesn’t fit the format. |
| Province | The province the code belongs to, such as İstanbul. |
Add --json to get the same result as JSON, for scripts:
anpr infer car.jpg --jsonThe CLI doesn’t write anything to the database.
The service and its web page
Section titled “The service and its web page”Start the service:
anpr serveOpen http://localhost:8000. The page has two ways in:
- Upload an image. It goes to
POST /api/v1/inferand the plates are listed under it. - Start the webcam. The page sends frames over
/ws/streamand shows each plate as it is read. Once a plate has been read on enough frames, it is marked as confirmed and stored as a hash.
The interactive API reference, generated by FastAPI, is at http://localhost:8000/docs.
If you didn’t set ANPR_PLATE_HMAC_PEPPER, the service makes up a random pepper and warns you.
That is fine for trying it out. For real use, set one; see Configuration.