1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.88k stars 1.33k forks source link

Access to enum LandmarksType should be public #315

Closed FedericoCozziVM closed 3 months ago

FedericoCozziVM commented 2 years ago

LandmarksType enums types are marked as private and raise weak warnings when accessed (i.e. in README.md examples).

I can imagine that they're named with the underscore because of the impossibility of starting a variable name with a number - and because of the perfect naming 2D or 3D which is self-explicative. However, I propose to rename them in a more pythonic way, such as:

class LandmarksType(IntEnum):
    TWO_D = 1
    TWO_HALF_D = 2
    THREE_D = 3

Initialization would be:

fa = face_alignment.FaceAlignment(face_alignment.LandmarksType.TWO_D, face_detector='sfd')

and it would respect python language guidelines.