This repository contains PyTorch implementation of the graph semantic matching as a project of the deep learning course at ETH Zuich. The report can be found here. This code is based off of the implementation of Github.
- Install all the python packages in requirements.txt by doing
pip install -r reqiurements.txt
. You could optionally create a virtualenv. - Execute
PATH=$PATH:<Path to root of this folder>
- If you want to run experiment on Pascal VOC Keypoint dataset:
- Download VOC2011 dataset and make sure it looks like
data/PascalVOC/VOC2011
- Download keypoint annotation for VOC2011 from Berkeley server or google drive and make sure it looks like
data/PascalVOC/annotations
- Rename the original annotations folder inside
data/PascalVOC/VOC2011
toAnnotations_original
. So it should finally look like ````data/PascalVOC/VOC2011/Annotations_original/`` - Download the training pairs from Link. Make sure the train/test split is available in
data/PascalVOC/voc2011_pairs.npz
- Download VOC2011 dataset and make sure it looks like
- If you want to run experiment on CUB dataset, please download dataset from Link and extract all the contents to
data/CUB
folder.- Inside the data folder, execute
python CUB_processing.py
- Inside the data folder, execute
Run training and evaluation
python train_eval.py --cfg path/to/your/yaml
and replace path/to/your/yaml
by path to your configuration file. Configuration files for the experimets reported in the paper are stored inexperiments/
.
The config files are as follows:
-
PascalVoc experiments:
- gl_voc.yaml - With graph Learning
- fc_voc.yaml - With fully connected graphs
- delaunay_voc.yaml - With delaunay triangulation on the graph
- knn_1_voc.yaml - With knn connectivity with k=1 neighbour.
- knn_2_voc.yaml - With knn connectivity with k=2 neighbours.
- knn_3_voc.yaml - With knn connectivity with k=3 neighbours.
-
CUB experiments:
- gl_cub.yaml - With graph Learning
- fc_cub.yaml - With fully connected graphs
- delaunay_cub.yaml - With delaunay triangulation on the graph
- knn_1_cub.yaml - With knn connectivity with k=1 neighbour.
- knn_2_cub.yaml - With knn connectivity with k=2 neighbours.
- knn_3_cub.yaml - With knn connectivity with k=3 neighbours.
Flow diagram of the different stages of the graphmatching optimisation:
Graphs learnt by the network given images andkeypoints on Pascal VOC dataset