Skip to content

Commit c96541e

Browse files
Add comparison to nifty
1 parent 397e482 commit c96541e

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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()

0 commit comments

Comments
 (0)