Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Miranda
deepOF
Commits
b691903a
Commit
b691903a
authored
Feb 11, 2021
by
lucas_miranda
Browse files
Added looking around as a tag for single mice
parent
34c8e962
Changes
1
Hide whitespace changes
Inline
Side-by-side
deepof/pose_utils.py
View file @
b691903a
...
...
@@ -231,8 +231,6 @@ def dig(
- speed_dframe (pandas.DataFrame): speed of body parts over time
- likelihood_dframe (pandas.DataFrame): likelihood of body part tracker over time,
as directly obtained from DeepLabCut
- tol_nose_speed (float): Maximum tolerated average distance between spine
body parts
- tol_speed (float): Maximum tolerated speed for the center of the mouse
- tol_likelihood (float): Maximum tolerated likelihood for the nose (if the animal
is digging, the nose is momentarily occluded).
...
...
@@ -251,28 +249,37 @@ def dig(
return
digging
def
sniff
(
pos_dframe
:
pd
.
DataFrame
,
def
look_around
(
speed_dframe
:
pd
.
DataFrame
,
likelihood_dframe
:
pd
.
DataFrame
,
tol_nose_speed
:
float
,
tol_speed
:
float
,
tol_likelihood
:
float
,
animal_id
:
str
=
""
,
):
pass
"""Returns true when the mouse is digging using simple rules.
Parameters:
- speed_dframe (pandas.DataFrame): speed of body parts over time
- likelihood_dframe (pandas.DataFrame): likelihood of body part tracker over time,
as directly obtained from DeepLabCut
- tol_speed (float): Maximum tolerated speed for the center of the mouse
- tol_likelihood (float): Maximum tolerated likelihood for the nose (if the animal
is digging, the nose is momentarily occluded).
def
look_around
(
pos_dframe
:
pd
.
DataFrame
,
speed_dframe
:
pd
.
DataFrame
,
likelihood_dframe
:
pd
.
DataFrame
,
tol_nose_speed
:
float
,
tol_speed
:
float
,
tol_likelihood
:
float
,
animal_id
:
str
=
""
,
):
pass
Returns:
lookaround (np.array): True if the animal is standing still and looking around, False otherwise
"""
if
animal_id
!=
""
:
animal_id
+=
"_"
speed
=
speed_dframe
[
animal_id
+
"Center"
]
<
tol_speed
nose_speed
=
speed_dframe
[
animal_id
+
"Center"
]
<
speed_dframe
[
animal_id
+
"Nose"
]
nose_likelihood
=
likelihood_dframe
[
animal_id
+
"Nose"
]
>
tol_likelihood
lookaround
=
speed
&
nose_likelihood
&
nose_speed
return
lookaround
def
following_path
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment