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
cadd739b
Commit
cadd739b
authored
Feb 02, 2021
by
lucas_miranda
Browse files
Fixed a bug that made contacts too stringent
parent
1f24a2f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
deepof/data.py
View file @
cadd739b
...
...
@@ -56,7 +56,7 @@ class project:
exclude_bodyparts
:
List
=
tuple
([
""
]),
exp_conditions
:
dict
=
None
,
interpolate_outliers
:
str
=
"MA"
,
interpolation_limit
:
int
=
1
5
,
interpolation_limit
:
int
=
5
,
interpolation_std
:
int
=
2
,
likelihood_tol
:
float
=
0.75
,
model
:
str
=
"mouse_topview"
,
...
...
deepof/pose_utils.py
View file @
cadd739b
...
...
@@ -654,15 +654,16 @@ def tag_rulebased_frames(
cv2
.
ellipse
(
frame
,
arena
[
0
],
arena
[
1
],
arena
[
2
],
0
,
360
,
(
0
,
255
,
0
),
3
)
# Print body parts for debuging
for
bpart
in
coords
.
columns
.
levels
[
0
]:
cv2
.
circle
(
frame
,
(
int
(
coords
[
bpart
][
"x"
][
fnum
]),
int
(
coords
[
bpart
][
"y"
][
fnum
])),
radius
=
3
,
color
=
(
(
255
,
0
,
0
)
if
bpart
.
startswith
(
animal_ids
[
0
])
else
(
0
,
0
,
255
)
),
thickness
=-
1
,
)
if
not
np
.
isnan
(
coords
[
bpart
][
"x"
][
fnum
]):
cv2
.
circle
(
frame
,
(
int
(
coords
[
bpart
][
"x"
][
fnum
]),
int
(
coords
[
bpart
][
"y"
][
fnum
])),
radius
=
3
,
color
=
(
(
255
,
0
,
0
)
if
bpart
.
startswith
(
animal_ids
[
0
])
else
(
0
,
0
,
255
)
),
thickness
=-
1
,
)
# Print frame number
write_on_frame
(
"Frame "
+
str
(
fnum
),
corners
[
"downleft"
])
...
...
deepof/utils.py
View file @
cadd739b
...
...
@@ -395,9 +395,9 @@ def mask_outliers(
mask
=
None
if
mode
==
"and"
:
mask
=
outlier_mask_x
&
outlier_mask_y
&
outlier_mask_l
mask
=
(
outlier_mask_x
&
outlier_mask_y
)
|
outlier_mask_l
elif
mode
==
"or"
:
mask
=
(
outlier_mask_x
|
outlier_mask_y
)
&
outlier_mask_l
mask
=
(
outlier_mask_x
|
outlier_mask_y
)
|
outlier_mask_l
return
mask
...
...
@@ -490,6 +490,7 @@ def interpolate_outliers(
interpolated_exp
.
interpolate
(
method
=
"linear"
,
limit
=
limit
,
limit_direction
=
"both"
,
inplace
=
True
)
interpolated_exp
[
np
.
isnan
(
interpolated_exp
)]
=
np
.
nan
return
interpolated_exp
...
...
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