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

Extend sleap-track to allow text and CSV files as input for data_path #1870

Closed
emdavis02 opened this issue Jul 16, 2024 · 2 comments · Fixed by #1875
Closed

Extend sleap-track to allow text and CSV files as input for data_path #1870

emdavis02 opened this issue Jul 16, 2024 · 2 comments · Fixed by #1875
Assignees
Labels
enhancement New feature or request

Comments

@emdavis02
Copy link
Contributor

emdavis02 commented Jul 16, 2024

Original Issue and Original Pull Request:

Allow inference on multiple individual videos via sleap-track #1777, #1784

Problem Description

After having expanded sleap-track to support multiple videos inputs at once, we want to further simplify this process for projects with a large numbers of inputs.

Feature Proposal

  • allow text and csv files as input for data_path
  • text files would simply have a list of input video paths, whereas csv files would enable us to have a column of input file paths and a column of output file paths

Implementation Details

The code will be added to the sleap/nn/inference.py file, editing the processing of data_path and output_path to check for file type.

Documentation for the CLI will be updated to specify how to use this new feature. Specifically, the formatting required of the text and CSV files.

If this formatting is not followed, an error will be raised to avoid misreading of the inputed files.

Additional test cases will be made in test_inference to ensure the new feature has been successfully implemented

Documentation Changes

Changes will be made to the sleap-track section of the documentation

positional arguments:
data_path Path to data to predict on. This can be one of the following:

  • A .slp file containing labeled data.
  • A folder containing multiple video files in supported formats.
  • An individual video file in a supported format.
  • A CSV file with a column of file paths to video files in supported formats; an optional adjacent column can specify output file paths.
  • A text file with a path to a video file on each line.
@emdavis02 emdavis02 added the enhancement New feature or request label Jul 16, 2024
@emdavis02 emdavis02 self-assigned this Jul 16, 2024
@eberrigan
Copy link
Contributor

lgtm!
Plan your tests and updates to documentation as usual. Documentation will have to specify the formats of the text and csv files. If text or csv files are improperly formatted an error should be raised. Please include tests for that case.

@roomrys
Copy link
Collaborator

roomrys commented Dec 19, 2024

Long awaited, but finally integrated. This issue has been fixed in the SLEAP 1.4.1 release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants