Evaluate the similarity between two graphs, e.g. ground truth vs predicted skeletons of blood vessel segmentation.
You can call the code like this:
python main.py --gt tests/toygraph_GT.swc --pred tests/toygraph_predicted.swcIf you call only main.py without specifying the path variables for the ground truth and predicted graph, toy graphs from project/toydata.py will be used.
We make use of the networkx package. By their naming convention we only consider graphs which are branchings. A branching is a directed forest with each node having, at most, one parent. So the maximum in-degree is equal to 1. Nodes without parents are called roots. Nodes without children are called leaves.
Currently the following metrics are available:
Betti-0 errorBetti-1 errorPrecision,RecallandF1-scorewith respect to false merges (FP) and false splits (FN)Street Mover Distance(orSinkhorn distance) between two graphs viewed as point cloudsTree Edit Distance(tbd)
- Create a virtual environment with all necessary packages: torch, numpy, networkx (TODO: Create requirements.txt)
- Run
main.pyto print all current graph similarity metrics applied on two graphs. You can either use predefined toy graphs or load your own target and source graphs.