Skip to content

alignment_procedure crashes when both eyes are in the same position #94

@Dobiasd

Description

@Dobiasd

When looking at a face from the side, the landmark detector may give the same position for both eyes.

In that case, retinaface.commons.postprocess.alignment_procedure crashes with UnboundLocalError: cannot access local variable 'angle' where it is not associated with a value.

Some IDEs also highlight this problem:

IPjqZfD

Here is a minimal example to reproduce the problem:

import numpy as np
from retinaface.commons import postprocess

postprocess.alignment_procedure(np.zeros([123, 123, 3], dtype=np.uint8), (10, 10), (10, 10), (33, 33))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions