talmolab / sleap

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

Add option to analysis export for exporting predictions for all frames including those with no predictions #1624

Open vtsai881 opened 11 months ago

vtsai881 commented 11 months ago

Description

Previously, SLEAP-exported analysis csvs only included rows in which there was a predicted instance, meaning imports into downstream behavioral classification pipelines (e.g. SimBA), lack rows for frames that are missing tracking predictions. These set of changes to write_tracking_h5.py and the GUI add an option to the csv export menu to export with rows for all frames (frames with no predictions will be filled with 0).

Location of added buttons below: image

Types of changes

Does this address any currently open issues?

#1622

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

Summary by CodeRabbit

coderabbitai[bot] commented 11 months ago

Walkthrough

The recent updates to SLEAP focus on enhancing CSV export functionality. New menu items have been added for exporting CSVs with options to include all frames or only tracked ones, across current or all videos. The exportAnalysisFile and exportCSVFile methods now accept an all_frames boolean to toggle this feature. The write functions across various modules have been updated to support this parameter, streamlining the export process and providing users with more tailored data extraction.

Changes

File Path Change Summary
sleap/gui/app.py
sleap/gui/commands.py
Added menu items for CSV export with options for current/all videos and tracked/all frames. Updated exportAnalysisFile and exportCSVFile methods to include all_frames parameter.
sleap/info/write_tracking_h5.py
sleap/io/format/csv.py
sleap/io/format/nix.py
sleap/io/format/sleap_analysis.py
Adjusted various functions and methods to include or handle the all_frames parameter for CSV export.

🐇✨ In the land of code and bytes, A rabbit hopped through data nights. With CSVs now finely tuned, Export dreams are now festooned. 🌟📊

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 X ?


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - You can reply to a review comment made by CodeRabbit. - You can tag CodeRabbit on specific lines of code or files in the PR by tagging `@coderabbitai` in a comment. - You can tag `@coderabbitai` in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`