-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow inference on multiple individual videos via sleap-track
#1777
Labels
enhancement
New feature or request
Comments
Great job @emdavis02!
|
Just jumping in to say: please use pathlib instead of |
Thanks! Here is the correspondence between |
11 tasks
talmo
pushed a commit
that referenced
this issue
Jul 19, 2024
* implementing proposed code changes from issue #1777 * comments * configuring output_path to support multiple video inputs * fixing errors from preexisting test cases * Test case / code fixes * extending test cases for mp4 folders * test case for output directory * black and code rabbit fixes * code rabbit fixes * as_posix errors resolved * syntax error * adding test data * black * output error resolved * edited for push to dev branch * black * errors fixed, test cases implemented * invalid output test and invalid input test * deleting debugging statements * deleting print statements * black * deleting unnecessary test case * implemented tmpdir * deleting extraneous file * fixing broken test case * fixing test_sleap_track_invalid_output * removing support for multiple slp files * implementing talmo's comments * adding comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #1439
Problem Description
Originally posted by roomrys August 4, 2023
Currently, to run inference on multiple videos via the
sleap-track
command, users need to call this command many times either manually or in a script. It might be a nice feature to allow multiple videos/inputs.Feature Proposal
Implementation Details
Currently,
sleap_track
takes in an argumentdata_path
from the command line that is the file path to a.slp
file, this means that the user must run this function once for every video they wish to run an inference on either manually or through a script. We would like to allow the argumentdata_path
to also take in a path to a folder of.slp
files and run an inference on each of these files. This will all be acomplished insleap/nn/inference.py
1. Create an optional flag to the cli to specify if
data_path
is a folder_make_cli_parser()
functionsleap/sleap/nn/inference.py
Lines 5051 to 5068 in 43a4f13
2. Make
data_path
a list to enable iterationdata_path
data_path = [args.data_path]
Note: The
"labels"
cli argument has been deprecated and will not need to be edited to accomodate this new function.sleap/sleap/nn/inference.py
Lines 5292 to 5296 in 43a4f13
3. Add a loop to file loading lines
data_path
. The loop will encompass the entire code section shown below.provider
to a list to store a value for each item indata_path
sleap/sleap/nn/inference.py
Lines 5304 to 5328 in 43a4f13
4. Add a loop to
main()
for running inference and trackingIterate through
data_path
in the section of main shown below. The loop will start at line 5476, before we run the inference but after the predictor.tracker is set.sleap/sleap/nn/inference.py
Lines 5473 to 5485 in 43a4f13
transplate the following lines of code into the above loop. This will need to be run for each item in
data_path
sleap/sleap/nn/inference.py
Lines 5510 to 5541 in 43a4f13
5. Add an aditional loop to
main()
for just running trackingIterate through
data_path
for the following code. The loop will start after theelif
and contain the rest of the attatched lines.sleap/sleap/nn/inference.py
Lines 5487 to 5500 in 43a4f13
Again, we will have to transplant the following lines of code into the loop.
sleap/sleap/nn/inference.py
Lines 5510 to 5541 in 43a4f13
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:
.slp
file containing labeled data.optional arguments:
...
-o OUTPUT, --output OUTPUT The output filename or directory path to use for the predicted data. If not provided, defaults to '[data_path].predictions.slp'.
The text was updated successfully, but these errors were encountered: