netw0rkf10w / ADGM

Alternating Direction Graph Matching (ADGM)
https://khue.fr/publication/adgm/
6 stars 2 forks source link

Alternating Direction Graph Matching (ADGM)

This repository contains the code for ADGM introduced in the paper Alternating Direction Graph Matching (CVPR 2017) by D. Khuê Lê-Huu and Nikos Paragios.

A more recent implementation in Python can be found here: https://github.com/netw0rkf10w/pyADGM

v0.1, 24/02/2017, written by D. Khuê Lê-Huu.

If you use any part of this code, please cite:

@inproceedings{lehuu2017adgm,
 title={Alternating Direction Graph Matching},
 author={L{\^e}-Huu, D. Khu{\^e} and Paragios, Nikos},
 booktitle = {Proceedings of the {IEEE} Conference on Computer Vision and Pattern Recognition ({CVPR})},
 year = {2017}
}

Note

Installation

In Matlab, go to the folder ADGM/ and run:

compile.m

Usage

X = FUNCTION(X0, [], [], [], [], indH, valH, rho, MAX_ITER, verbose, eta, iter1, iter2);

where FUNCTION can be one of the following: ADGM1, ADGM2, ADGM1_SYMMETRIC, ADGM2_SYMMETRIC. If the third-order tensor valH is super-symmetric then you should use the _SYMMETRIC versions because they offer several times speedup by exploiting the symmetric structure of the tensor.

The parameters of the above function are:

Output X: the returned assignment matrix (N2 x N1) Intput:

Typical values are: rho = nP1*nP2/1000; MAX_ITER = 5000; eta = 2.0; iter1 = 200; iter2 = 50;

Important:

Demo

The script demo.m implements a synthetic third-order graph matching problem and solves it using the two variants of ADGM as well as Duchenne's Tensor Matching algorithm (for comparison).

To succesfully run it, follow the steps below:

  1. In Matlab, go to ann_mwrapper/ and run:

    ann_compile_mex
  2. Go back to the main folder and run:

    mex assignmentoptimal.cpp
  3. Go to TM/ and run:

    mex GCC='/usr/bin/g++-4.8' mexSource/mexComputeFeature.cpp -output mex/mexComputeFeature
    mex GCC='/usr/bin/g++-4.8' mexSource/mexTensorMatching.cpp -output mex/mexTensorMatching
  4. Go back to the main folder and run:

    demo

Troubleshooting

When running the demo, if you obtain errors like this:

Invalid MEX-file '*.mexa64':
Missing symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_' required by
'*.mexa64'

then probably your C++ compiler is not supported by MATLAB.

To resolve this issue, you can run mex -setup c++ and choose an appropritate compiler, as recommended by MATLAB's official documentation.

Alternatively, you can specify a compiler as an argument for mex. For example, on Linux:

mex GCC='/usr/bin/g++-4.8' <file.cpp>

Make sure to replace mex with mex GCC='/usr/bin/g++-4.8' to all the commands in the previous sections (including those in ADGM/compile.m).

For any questions or bug reports, please send me an email.