File tree Expand file tree Collapse file tree
development/graph/multicut Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ import bioimage_cpp as bic
4+
5+ from _compatibility import parser , run_comparison
6+
7+
8+ def main () -> None :
9+ args = parser (
10+ "Compare bioimage-cpp and nifty fusion-move multicut at default settings."
11+ ).parse_args ()
12+ # bioimage-cpp warm-starts from the trivial singleton labeling with a
13+ # greedy-additive pass before the proposal loop. Nifty's ccFusionMoveBased
14+ # exposes the same behaviour via the `warmStartGreedy=True` flag (which
15+ # internally chains a greedyAdditiveFactory in front of the fusion-move
16+ # factory). Both sides therefore enter the proposal loop from the same
17+ # starting point.
18+ run_comparison (
19+ "fusion_move" ,
20+ lambda : bic .graph .FusionMoveMulticut (
21+ proposal_generator = bic .graph .WatershedProposalGenerator (),
22+ ),
23+ lambda objective : objective .ccFusionMoveBasedFactory (
24+ proposalGenerator = objective .watershedCcProposals (),
25+ fusionMove = objective .fusionMoveSettings (
26+ mcFactory = objective .greedyAdditiveFactory (),
27+ ),
28+ numberOfIterations = 10 ,
29+ stopIfNoImprovement = 4 ,
30+ numberOfThreads = 1 ,
31+ warmStartGreedy = True ,
32+ ),
33+ args ,
34+ )
35+
36+
37+ if __name__ == "__main__" :
38+ main ()
You can’t perform that action at this time.
0 commit comments