This is the project for car plate OCR recognition, which include:
- Neural network segmentation model for car plate area with number selection (part 1/3)
- Neural network OCR model for plate character recognition (part 2/3)
- API service for these two models (part 3/3)
- Additional example how to use API service in Telegram bot
Fast API service is develop according two neural network model for car plate segmentation and OCR.
src/container_task.py
contain 2 classes:
Storage
- can save calculated data into*.json
(simple "caching" procedure).ProcessPlates
- can load ONNX models and process car plate numbers. After that, it save results inStorage
.
app.py
contain FastAPI application, which have 2 handles:
get_content
- return content according tocontent_id
.process_content
- generate content with NN models for uploaded image.
src/container_task.py
contain example of calculating procedure.
Used technologies:
- FastAPI
- Dependencies injector containers
- CI/CD (test, deploy, destroy)
- DVC
- Docker
- Unit & Integration tests with coverage report
- Linters (flake8 + wemake)
Disclaimers:
- the project was originally crated and maintained in GitLab local instance, some repo functionality may be unavailable
- the project was created by me and me only
Location for manual test:
- https://car_plates_api.lydata.duckdns.org
- docs https://car_plates_api.lydata.duckdns.org/docs#/default/process_content_process_content_post
First, create and activate venv
:
bash python3 -m venv venv . venv/bin/activate
Next, install dependencies:
bash make install
make install
- install python dependencies
make run_app
- run servie. You can define argumentAPP_PORT
make build
- you can define argumentsDOCKER_TAG
,DOCKER_IMAGE
make lint
- run linters
make run_unit_tests
- run unit testsmake run_integration_tests
- run integration testsmake run_all_tests
- run all tests