Change expression for direction detection

This commit is contained in:
Andrea Lanfranchi 2024-02-27 12:00:47 +01:00
parent d0ffc1bfde
commit 90053295cb
No known key found for this signature in database
GPG Key ID: 2D623A60BB279915

View File

@ -167,7 +167,7 @@ def rotate_facial_area(
# worry about rotations greater than 360 degrees.
# We workaround the quirky behavior of the modulo operator
# for negative angle values.
direction = (1, -1)[angle < 0]
direction = 1 if angle >= 0 else -1
angle = abs(angle) % 360
if angle == 0:
return facial_area