From fa5a82bdbba4b4750ffdea58c211413a35f5b39f Mon Sep 17 00:00:00 2001 From: Elizabeth Berrigan Date: Wed, 18 Dec 2024 14:50:22 -0800 Subject: [PATCH] add test for connect single breaks --- tests/nn/test_tracking_integration.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/nn/test_tracking_integration.py b/tests/nn/test_tracking_integration.py index 21d34380f..4a601ac00 100644 --- a/tests/nn/test_tracking_integration.py +++ b/tests/nn/test_tracking_integration.py @@ -180,6 +180,26 @@ def test_kalman_tracker( ) assert len(labels.tracks) == 2 + # Test with 'tracking.post_connect_single_breaks': 0 + cli = ( + f"--tracking.tracker {tracker_name} " + "--tracking.max_tracking 1 --tracking.max_tracks 2 " + f"--tracking.similarity {similarity} " + f"--tracking.match {match} " + "--tracking.track_window 5 " + "--tracking.kf_init_frame_count 10 " + "--tracking.kf_node_indices 0,1 " + "--tracking.target_instance_count 2 " + "--tracking.post_connect_single_breaks 0 " + f"-o {tmpdir}/{tracker_name}_max_tracks_target_instance_count_single_breaks.slp " + f"{centered_pair_predictions_slp_path}" + ) + inference_cli(cli.split(" ")) + labels = sleap.load_file( + f"{tmpdir}/{tracker_name}_max_tracks_target_instance_count_single_breaks.slp" + ) + assert len(labels.tracks) == 2 + def test_simple_tracker(tmpdir, centered_pair_predictions_slp_path): cli = (