Licence plate detection API with web service

GitHub Repo

The project is made as part of a deep learning course at ITMO University. The goal is to train and deploy a NN model for licence plate recognition.

Dataset and training

The dataset was downloaded from Open Images Dataset v6 using self written script, based on OIDv6 package. The main difference is that OIDv6 doesn’t allow to download images, containing both “Car” and “Vehicle licence plate” classes on a single picture. In order to solve the problem, a new script was written to only download images, which contain both classes. The script can be found here

Yolov7 was chosen for the project for its speed and accuracy benchmarks. It took almost 3 hours and 55 epochs to train on a dataset containing 4000 images.

Result of a trained yolov7 model

Building an API

The detection module is wrapped around Fast API service. The main task of the module is to receive a POST request, containing an image or video data {‘upload_file’: <image/video>} , process it, and return a json-type data, which contains the following:

  • date: datetime;
  • vehicle_type: str;
  • color: str;
  • number: str;
  • vehicle: list;
  • plate: list.

The scheme of an API service

Django web service

In order to use the API a django-based web service was created. After authentication, it allows the user to upload images with cars, send them to an API (must be launched. Otherwise, throws an error in the interface), process the result and save it into SQL database. All the processed images are saved in user’s profile and can be accessed anytime.