Skip to content

Commit

Permalink
kalman filter needs node indices, simple tracking and similarity anyt…
Browse files Browse the repository at this point in the history
…hing besides normalized
  • Loading branch information
eberrigan committed Dec 18, 2024
1 parent f61cd20 commit c3c5372
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sleap/nn/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,23 @@ def pre_cull_function(inst_list):

# Kalman filter requires deprecated target_instance_count
if (max_tracks or target_instance_count) and kf_init_frame_count:
if not kf_node_indices:
raise ValueError(
"Kalman filter requires node indices for instance tracking."
)

if tracker == "flow" or tracker == "flowmaxtracks":
# Tracking with Kalman filter requires initial tracker object to be simple
raise ValueError(
"Kalman filter requires simple tracker for initial tracking."
)

if similarity == "normalized_instance":
# Kalman filter doesnot support normalized_instance_similarity
raise ValueError(
"Kalman filter does not support normalized_instance_similarity."
)

if not target_instance_count:
# If target_instance_count is not set, use max_tracks instead
# target_instance_count not available in the GUI
Expand Down

0 comments on commit c3c5372

Please sign in to comment.