This is how the project directory is structured:
├── app
│ ├── config.py
│ ├── main.py
│ └── utils.py
│ ├── data # Database - Folder of images
│ │ ├── *.[jpg | jpeg]
|
├── query # Query - Folder of images need to find id
│ ├── *.[jpg | jpeg]
|
├── docker-compose.yml
├── docker_build.sh
├── docker_run_it_test.sh
├── docker_run_server.sh
├── requirements.txt
└── uvicorn_run.sh
-
data
: "database" which contains all users image uniquely by their id/name. -
query
: "query" which contains all images need to find identity base on the simmilarity between it with the image indatabase
-
I use docker volume to manage persistent data instead of using disk.
-
Face recognition model includes 2 modules:
face detection
andface recognition
. -
For editting detector and recognizer configuration, see config.py for your specific configuration. Otherwise leaves as default.
- Install dependencies
pip install -r requirements.txt
-
Create
./app/data
and./query
as directory structure above. -
Run the server
uvicorn app.main:app --host 0.0.0.0 --port 80
- Add
--reload
flag to enable live mode. - Go to
localhost:{port}/docs
for Swagger UI, check document for more information.
Directory structure in docker container:
├── /app
│ ├── app
│ │ ├── config.py
│ │ ├── main.py
│ │ ├── utils.py
| |
│ ├── data # Database - Folder of images
│ │ ├── *.[jpg | jpeg]
| |
│ ├── query # Query - Folder of images need to find id
│ │ ├── *.[jpg | jpeg]
| |
- Run the service
docker compose up --build -d
- Run manually
Build the image:
bash docker_build.sh
Run the container
bash docker_run_server.sh