-
Notifications
You must be signed in to change notification settings - Fork 100
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
Generate Sample Suggestions with less than number of sampled frames #773
Comments
Hi @eberrigan, Do you mind giving us a bit more info on the problem? Thanks, |
Sorry, the contents didn't save for some reason! Updated above. |
Problem AnalysisCurrently when using the stride method for generating suggestions, SLEAP will loop through each video and generate a list of indices to suggest using the following logic: vid_suggestions = list(
range(0, video.frames, video.frames // per_video)
)[:per_video] However, when perform the floor division While we are focused on this section of the code, we can also ensure that the method for generating random samples, which is currently implemented as: vid_suggestions = random.sample(range(video.frames), per_video) either uses the
Proposed Solution(s)Note: Sol'n 2 is likely best as it maintains the current functionality of suggestions via "stride".
TestTests should go in
Relevant files/functions
|
That sounds perfect!
…On Mon, Jun 6, 2022 at 1:59 PM Liezl Maree ***@***.***> wrote:
Problem Analysis
Currently when using the stride method for generating suggestions, SLEAP
will loop through each video and generate a list of indices to suggest
using the following logic
<https://github.com/talmolab/sleap/blob/67b4b3e762571e70beadf940a64ed62d9481dafe/sleap/gui/suggestions.py#L84>
:
vid_suggestions = list(
range(0, video.frames, video.frames // per_video)
)[:per_video]
However, when perform the floor division video.frames // per_video, we
get a zero for arg 3 of range() if the video is shorter than the
specified stride (stored in per_video).
Proposed Solution(s)
Note: Sol'n 1 is likely best as it maintains the current functionality of
suggestions via "stride".
1. Add a quick check if video.frames > per_video before generating
vid_suggestions.
2. *New option* to predict on per_project number of frames spaced
evenly throughout entire project.
Relevant files/functions
- L84
<https://github.com/talmolab/sleap/blob/67b4b3e762571e70beadf940a64ed62d9481dafe/sleap/gui/suggestions.py#L84>
VideoFrameSuggestions.basic_sample_suggestion_method() from
sleap/gui/suggestions.py
- L20
<https://github.com/talmolab/sleap/blob/67b4b3e762571e70beadf940a64ed62d9481dafe/sleap/config/suggestions.yaml#L20>
sleap\config\suggestions.yaml
- L1086
<https://github.com/talmolab/sleap/blob/67b4b3e762571e70beadf940a64ed62d9481dafe/sleap/gui/app.py#L1086>
MainWindow._create_dock_windows from sleap\gui\app.py
—
Reply to this email directly, view it on GitHub
<#773 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZOPO6X2BZJ572PKNQGJAXLVNZRDVANCNFSM5XVE52UQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Elizabeth Berrigan
Cell: (603) 318 9191
|
Hi @eberrigan, We have patched your issue in the development version of SLEAP. If you would like to use this version of SLEAP with the new changes please use the conda from source installation. Thanks, |
Hi @eberrigan , The new release of SLEAP v1.2.4 is now available for installation and includes this fix. Thanks, |
Genius! Thanks Liezl
…On Wed, Jun 29, 2022, 3:46 PM Liezl Maree ***@***.***> wrote:
Hi @eberrigan <https://github.com/eberrigan> ,
The new release of SLEAP v1.2.4 is now available for installation
<https://sleap.ai/installation.html> and includes this fix.
Thanks,
Liezl
—
Reply to this email directly, view it on GitHub
<#773 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZOPO6T4CJY3YA3X3W22HDTVRTG3LANCNFSM5XVE52UQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Bug description
Some of my videos only have 1 or 2 frames but most have 72. I would like to generate sample suggestions on everything with more than the number of samples I would like.
Expected behaviour
I generate (20) sample suggestions using the stride method. Only videos with more than 20 frames would have the sample suggestions generated.
Actual behaviour
Initializing sample suggestions window appears and value error is shown on command prompt. Nothing happens.
Your personal set up
Versions:
SLEAP: 1.2.1
TensorFlow: 2.8.0
Numpy: 1.21.5
Python: 3.7.13
OS: Windows-10-10.0.19041-SP0
System:
GPUs: 1/1 available
Device: /physical_device:GPU:0
Available: True
Initalized: False
Memory growth: True
Environment packages
Logs
Screenshots
How to reproduce
The text was updated successfully, but these errors were encountered: