Commit 8f163bf4 authored by Olegs NIKISINS's avatar Olegs NIKISINS

Moved condition to one line, removed empty dictionary check

parent e588deb4
Pipeline #17376 passed with stage
in 16 minutes and 43 seconds
......@@ -120,9 +120,8 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
for index, frame, _ in frames:
annots = None
# if annotations are given, and if particular frame annotations are not missing we take them:
if annotations is not None and index in annotations.keys() and annotations[index]: annots = annotations[index]
annots = annotations[index] if annotations is not None and index in annotations else None
# preprocess image (by default: detect a face)
preprocessed = self.preprocessor(frame, annots)
......
......@@ -73,9 +73,9 @@ def test_missing_annotations():
preprocessed_video = preprocessor(video, annotations)
assert len(preprocessed_video) == 2
assert len(preprocessed_video) == 3
assert preprocessed_video[0][1] == 3
assert [x[0] for x in preprocessed_video] == ['0', '3']
assert [x[0] for x in preprocessed_video] == ['0', '1', '3']
def test_detect():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment