Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements to tracking #1894

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
14 changes: 6 additions & 8 deletions sleap/config/pipeline_form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,6 @@ inference:
This tracker "shifts" instances from previous frames using optical flow
before matching instances in each frame to the <i>shifted</i> instances from
prior frames.'
# - name: tracking.max_tracking
# label: Limit max number of tracks
# type: bool
default: false
gitttt-1234 marked this conversation as resolved.
Show resolved Hide resolved
- name: tracking.max_tracks
label: Max number of tracks
type: optional_int
Expand Down Expand Up @@ -459,10 +455,12 @@ inference:
none_label: Use max (non-robust)
range: 0,1
default: 0.95
# - name: tracking.save_shifted_instances
# label: Save shifted instances
# type: bool
# default: false
- name: tracking.save_shifted_instances
label: Save shifted instances
help: 'Save the flow-shifted instances between elapsed frames. It improves
instance matching at the cost of using a bit more of memory.'
type: bool
default: false
- type: text
text: '<b>Kalman filter-based tracking</b>:<br />
Uses the above tracking options to track instances for an initial
Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/learning/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def run(self):
# count < 0 means there was an error and we didn't get any results.
if new_counts is not None and new_counts >= 0:
total_count = items_for_inference.total_frame_count
no_result_count = total_count - new_counts
no_result_count = max(0, total_count - new_counts)

message = (
f"Inference ran on {total_count} frames."
Expand Down
4 changes: 3 additions & 1 deletion sleap/gui/widgets/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ def __init__(self, state=None, player=None, *args, **kwargs):
self.click_mode = ""
self.in_zoom = False

self._down_pos = None

self.zoomFactor = 1
anchor_mode = QGraphicsView.AnchorUnderMouse
self.setTransformationAnchor(anchor_mode)
Expand Down Expand Up @@ -1039,7 +1041,7 @@ def mouseReleaseEvent(self, event):
scenePos = self.mapToScene(event.pos())

# check if mouse moved during click
has_moved = event.pos() != self._down_pos
has_moved = self._down_pos is not None and event.pos() != self._down_pos
getzze marked this conversation as resolved.
Show resolved Hide resolved
getzze marked this conversation as resolved.
Show resolved Hide resolved
if event.button() == Qt.LeftButton:

if self.in_zoom:
Expand Down
Loading
Loading