self.detector = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device=device)
File "py73base/lib/python3.7/enum.py", line 349, in __getattr__
raise AttributeError(name) from None
AttributeError: _2D
在较新的版本中,_2D已经被移除了。
通过查看face_alignment的官方文档,发现只要把_2D改为Two_D就可以了。
pip install face_alignment==1.3.4