This code is an implementation of a deep learning method for dog identification. It relies on the triplet loss defined in FaceNet paper and on novel deep learning techniques as ResNet networks.
Dog faces pictures were retrieved from the web and aligned using three handmade labels. The dataset is available here: Zenodo
To create a virtual environment, run:
python -m venv venvThen activate it:
On Linux/Mac:
source venv/bin/activateOn Windows:
venv\Scripts\activateAfter creating a virtual environment, the dependencies should be installed with:
pip install -r requirements.txtThen run the following command from the root directory of the project:
python dogfacenet/dogfacenet.pyTo run properly the dataset has to be located in a data/dogfacenet folder or you will have to edit the config part of the dogfacenet.py file.
The above command will train a model and save it into output/model directory. It will also save its history in output/history.
This project is organized as follows:
dogs_recognition/
├── data/
├── doc/
├── dogfacenet/
│ ├── __init__.py
│ ├── dogfacenet.py
│ ├── offline_training.py
│ └── online_training.py
├── output/
│ ├── model/
│ └── history/
├── requirements.txt
└── README.md
The stable version of the DogFaceNet is located at the dogfacenet folder. The files are arranged as the following:
- dogfacenet: dataset loading, model definiton and training
- offline/online_training: function for triplet generation
The rest of the project contains:
- output:
- model: the trained models
- history: the convergence curves and training history
This repository is based on the first implementation of the dogFaceNet, by Guillaume Mougeot, wich is provided by this link