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
dd27cda1
Commit
dd27cda1
authored
Mar 07, 2021
by
lucas_miranda
Browse files
Added nose2body to rule_based_annotation()
parent
41e55045
Pipeline
#95166
failed with stages
in 21 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
deepof/pose_utils.py
View file @
dd27cda1
...
...
@@ -859,14 +859,6 @@ def tag_rulebased_frames(
else
:
return
150
,
150
,
255
zipped_pos
=
list
(
zip
(
animal_ids
,
[
corners
[
"downleft"
],
corners
[
"downright"
]],
[
corners
[
"upleft"
],
corners
[
"upright"
]],
)
)
# Keep track of space usage in the output video
# The flags are set to False as soon as the lower
# corners are occupied with text
...
...
@@ -935,7 +927,30 @@ def tag_rulebased_frames(
else
:
right_flag
=
False
# for _id, down_pos, up_pos in zipped_pos:
zipped_pos
=
list
(
zip
(
animal_ids
,
[
corners
[
"downleft"
],
corners
[
"downright"
]],
[
corners
[
"upleft"
],
corners
[
"upright"
]],
[
left_flag
,
right_flag
],
)
)
for
_id
,
down_pos
,
up_pos
,
flag
in
zipped_pos
:
if
flag
:
if
tag_dict
[
_id
+
undercond
+
"climbing"
][
fnum
]:
write_on_frame
(
"climbing"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"huddle"
][
fnum
]:
write_on_frame
(
"huddling"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"sniffing"
][
fnum
]:
write_on_frame
(
"sniffing"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"dig"
][
fnum
]:
write_on_frame
(
"digging"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"lookaround"
][
fnum
]:
write_on_frame
(
"lookaround"
,
down_pos
)
# if (
# tag_dict[_id + "_following"][fnum]
# and not tag_dict[_id + "_climbing"][fnum]
...
...
@@ -946,19 +961,6 @@ def tag_rulebased_frames(
# conditional_col(),
# )
for
_id
,
down_pos
,
up_pos
in
zipped_pos
:
if
tag_dict
[
_id
+
undercond
+
"climbing"
][
fnum
]:
write_on_frame
(
"climbing"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"sniffing"
][
fnum
]:
write_on_frame
(
"sniffing"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"huddle"
][
fnum
]:
write_on_frame
(
"huddling"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"dig"
][
fnum
]:
write_on_frame
(
"digging"
,
down_pos
)
elif
tag_dict
[
_id
+
undercond
+
"lookaround"
][
fnum
]:
write_on_frame
(
"lookaround"
,
down_pos
)
# Define the condition controlling the colour of the speed display
if
len
(
animal_ids
)
>
1
:
colcond
=
frame_speeds
[
_id
]
==
max
(
list
(
frame_speeds
.
values
()))
...
...
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