This is the continued repository for the identity document (ID) classification API. It was created by Group ING 2 as a part of the 2022-2023 Software Engineering course at the University of Groningen and was done in collaboration with ING. The API can receive a PDF of an ID over a POST request and return the ID class (ID card, driving license or passport) in the response.
- Python 3.9
- FastAPI
- pdf2image
- Tensorflow
- Python 3.9
- Pytest
They can be found here.
Inside the root directory of the trainer application, there is a directory called model_export
which contains the trained models. These models need to be copied into a directory called models
in the root directory of this project. Please do as follows:
Copy all of the contents (not the directory itself!) from the model_export
directory into the models
directory.
Currently, the models
directory contains dummy models in order to be able to start the API as well as run tests.
ING Employees, please use Production Mode!
This mode runs the FastAPI app with hot reload enabled so any changes made to the code will be reflected in the docker container.
Create the env file from .env.example
:
cp .\.env.example .\.env
Build the docker compose and then run it:
docker-compose build
docker-compose up -d
View the logs in follow mode:
docker-compose logs -f
Run tests:
docker-compose exec app pytest
This mode runs the fast api app with hot reload disabled.
Create the env file from .env.example
:
cp .\.env.example .\.env
Pull the docker-compose image and then run it:
docker-compose -f docker-compose.prod.yml pull
docker-compose -f docker-compose.prod.yml up -d
View the logs in follow mode:
docker-compose -f docker-compose.prod.yml logs -f
- Configure Docker and Tensorflow for GPUs
- Configure prediction confidences
- Configure model deployment