Skip to content
GitLab
Menu
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
b2f4bbb6
Commit
b2f4bbb6
authored
Jan 18, 2021
by
lucas_miranda
Browse files
Added testing examples for multi animal deepof pipeline
parent
74993ad3
Pipeline
#91441
passed with stage
in 22 minutes and 36 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
deepof/pose_utils.py
View file @
b2f4bbb6
...
...
@@ -556,7 +556,7 @@ def rule_based_tagging(
hparams
[
"huddle_forward"
],
hparams
[
"huddle_spine"
],
hparams
[
"huddle_speed"
],
animal_id
=
_id
animal_id
=
_id
,
)
)
...
...
@@ -602,13 +602,14 @@ def tag_rulebased_frames(
else
:
return
150
,
255
,
150
zipped_pos
=
zip
(
zipped_pos
=
list
(
zip
(
animal_ids
,
[
corners
[
"downleft"
],
corners
[
"downright"
]],
[
corners
[
"upleft"
],
corners
[
"upright"
]],
)
)
)
if
len
(
animal_ids
)
>
1
:
if
tag_dict
[
"nose2nose"
][
fnum
]
and
not
tag_dict
[
"sidebyside"
][
fnum
]:
write_on_frame
(
"Nose-Nose"
,
conditional_pos
())
if
(
...
...
@@ -659,7 +660,10 @@ def tag_rulebased_frames(
colcond
=
hparams
[
"huddle_speed"
]
>
frame_speeds
write_on_frame
(
str
(
np
.
round
(
frame_speeds
,
2
))
+
" mmpf"
,
str
(
np
.
round
((
frame_speeds
if
len
(
animal_ids
)
==
1
else
frame_speeds
[
_id
]),
2
)
)
+
" mmpf"
,
up_pos
,
conditional_col
(
cond
=
colcond
),
)
...
...
tests/test_pose_utils.py
View file @
b2f4bbb6
...
...
@@ -385,7 +385,9 @@ def test_rule_based_tagging(multi_animal, video_output):
animal_ids
=
([
"B"
,
"W"
]
if
multi_animal
else
[
""
]),
).
run
(
verbose
=
True
)
hardcoded_tags
=
prun
.
rule_based_annotation
(
video_output
=
video_output
,
frame_limit
=
50
)
hardcoded_tags
=
prun
.
rule_based_annotation
(
video_output
=
video_output
,
frame_limit
=
50
)
assert
type
(
hardcoded_tags
)
==
deepof
.
data
.
table_dict
assert
list
(
hardcoded_tags
.
values
())[
0
].
shape
[
1
]
==
(
13
if
multi_animal
else
3
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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