sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
287 stars 140 forks source link

Error in Extract Features Rolling Filter #56

Closed lucytian828 closed 4 years ago

lucytian828 commented 4 years ago

Describe the bug I'm doing a test run using an hour long mp4 file and DLC labels for 1 animal, 8 body parts. Extract Features appears to be working until it hits "Calculating rolling windows: medians, medians, and sums..." at which I get the following error:

Simba error

Desktop (please complete the following information):

sgoldenlab commented 4 years ago

Hi @lucytian828 - the first thing that comes to mind is the fps of your video. Is it less than 15 fps? SimBA tries to divide the frames into rolling bins, with the smallest being 66ms, (fps / 15) if you can't do this (for example a single frame is longer than 66ms) this would happen. If that's the case we can modify the feature extraction script.

lucytian828 commented 4 years ago

That would be the issue. The fps is slightly less than 15.

sgoldenlab commented 4 years ago

@lucytian828 - there's currently no way of modifying the rolling window sized directly in the project_config.ini but I will include it in the future.

To get rid of, or add/change rolling window sized navigate to SimBAs feature extraction scripts. On my computer they are in this path but it will be slightly different for you as you are using Anaconda: C:\Python36\Lib\site-packages\simba\features_scripts.

Next, open the feature extraction script you are using. One animal and 8bps would be the extract_features_8bp.py script. The critical line you need to edit is line 34, and specifically the last value in this list:

image

Currently it says 15, which means it tries to divide your fps with 15 - and it returns a value less than 1. Try changing it to 14 and let me know how it goes.

lucytian828 commented 4 years ago

That did the trick, thanks!