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
286 stars 139 forks source link

features Sum_probabilities, Mean_probabilities, Low_prob_detections_x are all zero (SLEAP import) #121

Closed smidm closed 3 years ago

smidm commented 3 years ago

Describe the bug

The probabilities are correctly loaded, see 1_head_1_p column in the features_extracted/fileneame.csv:

1_head_1_x 1_head_1_y 1_head_1_p
0 584.65966796875 148.553298950195 0.94010466337204
1 600.471740722656 152.566101074219 0.900553524494171
2 616.349243164063 156.568862915039 0.921086132526398
3 624.386596679688 160.406555175781 0.936960339546204

all features seems calculated except for the probability based:

Sum_All_bp_movements_2_mean_15 Sum_probabilities Mean_probabilities Low_prob_detections_0.1 Low_prob_detections_0.5 Low_prob_detections_0.75
36.0192956359203 0 0 0 0 0
0.315870048413295 0 0 0 0 0
0.278654693316602 0 0 0 0 0
0.080197638704377 0 0 0 0 0

To Reproduce Steps to reproduce the behavior:

  1. load SLP file with 2 ants with 3 bodyparts
  2. skip outlier correction
  3. compute features

Expected behavior Sum_probabilities, Mean_probabilities, Low_prob_detections_x features should have correct values

Desktop (please complete the following information):

sronilsson commented 3 years ago

Thanks for reporting this, very helpful. I found it, a bug in simba.feature_scripts.extract_features_user_defined.py, I think axis=1 has to be added at line 158-159. I will let you know when fixed.

Untitled_2
inoejj commented 3 years ago

@smidm I have fixed it, please let me know if this fixes your problem.

Please install the latest version of development wheel.

pip install simba-uw-tf-dev==0.84.9 --upgrade
smidm commented 3 years ago

Thanks! I have tested simba-uw-tf-dev-0.85.0 and the features are correct.