talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
435 stars 97 forks source link

Redraw overlays on plot change #1435

Closed roomrys closed 1 year ago

roomrys commented 1 year ago

Description

Previously, overlays had an open reference even after they were cleared from the player. This PR Ensures that when QtVideoPlayer.reset is called, the changedPlot signal is emitted which handles overlays and gui states.

Note: When a video is removed via the RemoveVideo command, this will call the MainWindow.on_data_update function with a topic of UpdateTopic.frame. The MainWindow.on_data_update will then be called a second time with the UpdateTopic.frame if the video removed is the last video (which then calls QtVideoPlayer.reset). Although redundant, this will not be an expensive operation since most the data from the slp will be removed at this point (all LabeledFrames, Suggestions, and Videos).

Types of changes

Does this address any currently open issues?

[list open issues here]

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

codecov[bot] commented 1 year ago

Codecov Report

Merging #1435 (d48935b) into shrivaths/remove-last-video-fix (380a44b) will decrease coverage by 0.02%. The diff coverage is 70.00%.

@@                         Coverage Diff                         @@
##           shrivaths/remove-last-video-fix    #1435      +/-   ##
===================================================================
- Coverage                            73.04%   73.03%   -0.02%     
===================================================================
  Files                                  133      133              
  Lines                                23762    23768       +6     
===================================================================
+ Hits                                 17358    17359       +1     
- Misses                                6404     6409       +5     
Files Changed Coverage Δ
sleap/gui/widgets/video.py 64.34% <0.00%> (-0.74%) :arrow_down:
sleap/gui/app.py 75.38% <100.00%> (+0.07%) :arrow_up:
sleap/gui/overlays/base.py 58.97% <100.00%> (+5.02%) :arrow_up:
sleap/gui/overlays/tracks.py 66.92% <100.00%> (+0.78%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more