Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.face
Commits
1533b950
Commit
1533b950
authored
3 years ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
Failed annotations don't assume nearest positions.
parent
9a08b32a
No related branches found
No related tags found
1 merge request
!106
Vulnerability framework - CSV datasets
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/database/replaymobile.py
+2
-12
2 additions, 12 deletions
bob/bio/face/database/replaymobile.py
with
2 additions
and
12 deletions
bob/bio/face/database/replaymobile.py
+
2
−
12
View file @
1533b950
...
...
@@ -141,19 +141,9 @@ def read_frame_annotation_file_replaymobile(file_name, frame, annotations_type="
video_annotations
=
read_annotation_file
(
file_name
,
annotation_type
=
annotations_type
)
# read_annotation_file returns an ordered dict with str keys as frame number
# Annotations can be "null". Take the last annotated frame in this case
offset
=
1
frame_annotations
=
video_annotations
[
f
"
{
frame
}
"
]
frame_annotations
=
video_annotations
[
str
(
frame
)]
if
frame_annotations
is
None
:
logger
.
warning
(
f
"
Annotation for file
'
{
file_name
}
'
at frame
{
frame
}
was
'
null
'
retrieving nearest frame
'
s annotations.
"
)
while
frame_annotations
is
None
:
frame_annotations
=
video_annotations
[
f
"
{
max
(
frame
-
offset
,
1
)
}
"
]
if
frame_annotations
is
not
None
:
break
frame_annotations
=
video_annotations
[
f
"
{
min
(
frame
+
offset
,
len
(
video_annotations
)
-
1
)
}
"
]
offset
+=
1
if
frame
-
offset
<
1
and
frame
+
offset
>
len
(
video_annotations
):
raise
IOError
(
f
"
Annotations file
'
{
file_name
}
'
does not contain any annotations.
"
)
logger
.
warning
(
f
"
Annotation for file
'
{
file_name
}
'
at frame
{
frame
}
was
'
null
'
.
"
)
return
frame_annotations
class
FrameBoundingBoxAnnotationLoader
(
AnnotationsLoader
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment