This repo implements a resnet-based siamese network for representation learning. You can run th project using the following steps ;
For this example we use the Tootally-Looks-Like dataset. To use it, we recommend converting the dataset into tfds format (see tfds_look.py). We split this dataset into 5000 image pairs for training and 116 for testing. You can dowloand the tfds format of the dataset from here. Please download it and apply tar -xf into ~/tensorflow_datasets.
python train.py -config config/look.ini -model RESNET -gpu 0
You can download the trained model from here. Apply tar -xf into the project folder.
We will apply similarity search to test the trained encoder. To this end, we can use the sim_search project. Then apply the folowing steps:
- Download the testing images. The dataset contains two parallel folders (right and left).
- Generate two files, one with the files in the folder right and the other with those in the left.
- Run python ssearch.py -config <SIAMESE_NETWORK FOLDER>config/look.ini -catalog -query -model_path
After running you will get some results in the folder results. Some examples appear below (first image is the query and the rest are ordered according to the similarity with the first):