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.94k stars 1.33k forks source link

Problem with import face_alignment #180

Closed hermankant closed 4 years ago

hermankant commented 4 years ago

I used it before and everything was working until suddenly after I ran the script, an error occurred just by importing face_alignment.

Traceback (most recent call last):
  File "C:/Users/.../ForPython/facePoints.py", line 1, in <module>
    import face_alignment
  File "C:\ProgramData\Anaconda3\lib\site-packages\face_alignment\__init__.py", line 7, in <module>
    from .api import FaceAlignment, LandmarksType, NetworkSize
  File "C:\ProgramData\Anaconda3\lib\site-packages\face_alignment\api.py", line 31
    def 3D(self):
        ^
SyntaxError: invalid syntax

the code at that place looks like that:

class LandmarksType(Enum):
    """Enum class defining the type of landmarks to detect.

    ``_2D`` - the detected points ``(x,y)`` are detected in a 2D space and follow the visible contour of the face
    ``_2halfD`` - this points represent the projection of the 3D points into 3D
    ``_3D`` - detect the points ``(x,y,z)``` in a 3D space

    """
    _2D = 1
    _2halfD = 2
    _3D = 3

    @property
    def 3D(self):  # error is here

class NetworkSize(Enum):
    # TINY = 1
    # SMALL = 2
    # MEDIUM = 3
    LARGE = 4

Should I change anything? or perhaps reinstall it differently if you see any specific issue?

1adrianb commented 4 years ago

@hermankant That line of code doesn't exist in the code. Could you perhaps try to reinstall it?

hermankant commented 4 years ago

I was positive I did it before. It worked now