Closed ramizhajj1 closed 5 months ago
[!IMPORTANT]
Auto Review Skipped
Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
This update involves a significant overhaul focused on managing OpenCV versions and enhancing the functionality of the SLEAP application. It includes a hack to ensure compatibility with a specific OpenCV version across different platforms and scripts. Additionally, new features and improvements in the GUI, error handling, and data processing for camera and dataset management have been added, alongside updated testing frameworks to support these changes.
Files | Change Summary |
---|---|
.conda/bld.bat , .conda/build.sh , .conda_mac/build.sh |
Added hack to manage OpenCV versions. |
.github/workflows/ci.yml |
Updated CI workflow to handle OpenCV version. |
dev_requirements.txt |
Added comment on pytest-xvfb . |
docs/installation.md |
Included instructions for OpenCV version management hack. |
environment.yml , environment_no_cuda.yml , requirements.txt |
Updated OpenCV dependencies. |
sleap/config/shortcuts.yaml |
Added new keyboard shortcuts. |
sleap/gui/... , sleap/io/... , sleap/instance.py |
Enhanced GUI and backend functionalities for better management. |
tests/... |
Expanded tests to cover new functionalities. |
π°β¨ In the code's garden, changes bloom, A rabbit hops through, room by room. With a hack here and a tweak there, New paths unfold with utmost care. Cheers to the craft, so deftly spun, Under the code moon, or the script sun. ππ π°β¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 79.06977%
with 18 lines
in your changes are missing coverage. Please review.
Project coverage is 74.12%. Comparing base (
3cb6fc7
) to head (d39b9f2
).:exclamation: Current head d39b9f2 differs from pull request most recent head 22e3bdb. Consider uploading reports for the commit 22e3bdb to get more accurate results
Files | Patch % | Lines |
---|---|---|
sleap/gui/commands.py | 77.08% | 11 Missing :warning: |
sleap/gui/app.py | 73.91% | 6 Missing :warning: |
sleap/io/cameras.py | 93.33% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Add menu to assign an
Instance
to anInstanceGroup
sessionsMenu
named "Sessions" (similar to thetracksMenu
)self.inst_groups_menu
attribute to theMainWindow
that adds a menu to thesessionsMenu
called "Set Instance Group" (similar toself.track_menu
)self.inst_groups_menu
whenhas_selected_instance == True
(similar toself.track_menu
)MainWindow._update_sessions_menu
method that takes inself
andframe_idx
, then retrieves thesession: Optional[RecordingSession] = self.state["session"]
and theframe_group: FrameGroup = session.frame_groups[frame_idx]
. First clear theself.inst_groups_menu
. Then, enumerate through allinstance_groups
inframe_group.instance_groups: List[InstanceGroup]
. For the first 9InstanceGroup
s use thekey_command = Qt.SHIFT + Qt.Key_0 + inst_group_ind + 1
(otherwise use a defaultkey_command = ""
). For allinstance_groups
, add aself.inst_groups_menu
action with nameinstance_group.name
, callbacklambda x=instance_group: self.commands.setInstanceGroup(x)
, and shortcut ofkey_command
. Outside the enumeration, add a"New Instance Group"
action to theself.inst_groups_menu
with name"New Instance Group"
, callbackself.commands.addInstanceGroup
, and hotkeyQt.SHIFT + Qt.Key_0
. Very similar toMainWindow._update_track_menu
.CommandContext.setInstanceGroup(self, instance_group: Optional[InstanceGroup])
method that executes theSetSelectedInstanceGroup
class with inputinstance_group=instance_group
(seeCommandContext.setInstanceTrack
).CommandContext.addInstanceGroup(self)
method that executes theAddInstanceGroup
class (seeCommandContext.addTrack
).sleap/gui/commands.py
add aSetSelectedInstanceGroup
class that subclassesEditCommand
. Add aSetSelectedInstanceGroup.do_action(context, params)
staticmethod that first retrieves theselected_instance = context.state[selected_instance]
,frame_idx: int = context.state["frame_idx"]
,video: Video = context.state["video"]
,session: RecordingSession = context.state["session"]
,frame_group: FrameGroup = session.frame_groups.get(frame_idx, None)
, andcamera = session.get_camera(video=video)
. You will need to useframe_group = session.new_frame_group(frame_idx=frame_idx)
ifframe_group is None
. Then, useframe_group.add_instance(instance=selected_instance, camera=camera, instance_group=instance_group)
to add theselected_instance
to theinstance_group
(andframe_group
). Similar to theSetSelectedInstanceTrack
class.sleap/gui/commands.py
add aAddInstanceGroup
class that subclassesEditCommand
. Add aAddInstanceGroup.do_action(context, params)
staticmethod that first retrieves theframe_idx: int = context.state["frame_idx"]
,session: RecordingSession = context.state["session"]
, andframe_group: FrameGroup = session.frame_groups[frame_idx]
. Then, useframe_group.add_instance_group(instance_group=None)
to create and add a new emptyInstanceGroup
to theframe_group
. Similar to theAddTrack
class.Using the workflow above (but with less detailed write-up), please also: