update readme

This commit is contained in:
Mathieu Broillet 2024-08-04 13:23:52 +02:00
parent 8d5c55fb88
commit 224d566d65
Signed by: mathieu
GPG Key ID: C4A6176ABC6B2DFC

View File

@ -13,17 +13,19 @@ This script is intended to be used as a faster local alternative to the large an
## Usage ## Usage
The server listens on port 5000 and has one endpoint: /v1/image/alpr. The endpoint accepts POST requests with an The server listens on port 5000 and has a few endpoints (see below), the most important one being ``/v1/image/alpr``.
image file in the 'upload' field. The image is processed using the ultimateALPR SDK and the license plate
information is returned in JSON format. The reponse follows the CodeProject AI ALPR API format. So it can be used
as a drop-in replacement for the [CodeProject AI ALPR API](https://www.codeproject.com/AI/docs/api/api_reference.html#license-plate-reader).
### /v1/vision/alpr
> POST: http://localhost:5000/v1/vision/alpr > POST: http://localhost:5000/v1/vision/alpr
**Description**
This endpoint processes an image and returns the license plate information (if any) found in the image.
This endpoint follows the [CodeProject AI ALPR API](https://www.codeproject.com/AI/docs/api/api_reference.html#license-plate-reader) format *(example below)* so it can be used as a **drop-in replacement** for the CodeProject AI software.
**Parameters** **Parameters**
- upload: (File) The image file to process. (see [Pillow.Image.open()](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open) for supported formats) - upload: (File) The image file to process. *(see [Pillow.Image.open()](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open) for supported formats, almost any image format is supported)*
- grid_size: (Integer, optional) The grid size to use when no match have been found on the whole image (default: 4) - grid_size: (Integer, optional) Size of grid to divide the image into and retry on each cell when no match have been found on the whole image *(default: 4)* **[(more info)](#more-information-about-the-grid-parameter)**
- wanted_cells: (String, optional) The wanted cells to use when no match have been found on the whole image (default: all cells) - wanted_cells: (String, optional) The cells you want to process *(default: all cells)* **[(see here)](#v1visionalpr_grid_debug)**
- format: ``1,2,3,4,...`` *(comma separated list of integers, max: grid_size^2)* - format: ``1,2,3,4,...`` *(comma separated list of integers, max: grid_size^2)*
- *Example for a grid_size of 3:* - *Example for a grid_size of 3:*
``` ```
@ -44,6 +46,26 @@ as a drop-in replacement for the [CodeProject AI ALPR API](https://www.codeproje
} }
``` ```
### /v1/vision/alpr_grid_debug
> POST: http://localhost:5000/v1/vision/alpr_grid_debug
**Description**
This endpoint displays the grid and each cell's number on the image.
It is intended to be used for debugging purposes to see which cells are being processed.
**Parameters**
*same as [v1/vision/alpr](#v1visionalpr)*
**Response**
```json
{
"image": (Base64) // The image with the grid and cell numbers drawn on it.
}
```
## More information about the grid parameter
*To write*
## Included models in built executable ## Included models in built executable
When using the built executable, only the **latin** charset models are bundled by default. If you want to use a different When using the built executable, only the **latin** charset models are bundled by default. If you want to use a different