Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
eberrigan committed Dec 17, 2024
1 parent b352307 commit 590ce93
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sleap/nn/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,14 @@ def flow_shift_instances(
This function relies on the Lucas-Kanade method for optical flow estimation.
"""

print(f"Image type before converting: {type(ref_img)}")

# Convert to uint8 for cv2.calcOpticalFlowPyrLK
ref_img = ensure_int(ref_img)
new_img = ensure_int(new_img)

print(f"Image type after converting: {type(ref_img)}")

# Convert tensors to ndarays
if hasattr(ref_img, "numpy"):
ref_img = ref_img.numpy()
Expand Down Expand Up @@ -1081,9 +1085,9 @@ def get_by_name_factory_options(cls):

option = dict(name="of_window_size", default=21)
option["type"] = int
option[
"help"
] = "For optical-flow: Optical flow window size to consider at each pyramid "
option["help"] = (
"For optical-flow: Optical flow window size to consider at each pyramid "
)
"scale level"
options.append(option)

Expand All @@ -1110,9 +1114,9 @@ def int_list_func(s):

option = dict(name="kf_init_frame_count", default="0")
option["type"] = int
option[
"help"
] = "For Kalman filter: Number of frames to track with other tracker. 0 means no Kalman filters will be used."
option["help"] = (
"For Kalman filter: Number of frames to track with other tracker. 0 means no Kalman filters will be used."
)
options.append(option)

def float_list_func(s):
Expand Down

0 comments on commit 590ce93

Please sign in to comment.