Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
Currently, the face alignment procedure considers the eye positions and makes use of the Cosine Law to calculate the needed rotation angle. However, the angle can actually be calculated by a simple use of the
np.arctan2
function.In this PR, I proposed to vastly simplify the
alignment_procedure
function, while keeping the semantics of the function unchanged so that nothing will break, e.g., left-eye is the eye to the left of the viewer, as in the original code.I have also prepared the following snippet, to illustrate that the angle calculated by the current method, and the newly proposed method, are the same. This snippet calculates the angle found by the two methods at different relative eye positions, and print out the angle values for comparison.
Please feel free to let me know if there are any concerns.
Thanks in advance for your consideration!