minivision-ai / photo2cartoon

人像卡通化探索项目 (photo-to-cartoon translation project)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error : raise AttributeError(name) from None

themass opened this issue · comments

save_path ~/Downloads/test.jpg
Traceback (most recent call last):
File "/Users/liguoqing/work/photo2cartoon/test.py", line 59, in
c2p = Photo2Cartoon()
^^^^^^^^^^^^^^^
File "/Users/liguoqing/work/photo2cartoon/test.py", line 19, in init
self.pre = Preprocess()
^^^^^^^^^^^^
File "/Users/liguoqing/work/photo2cartoon/utils/preprocess.py", line 8, in init
self.detect = FaceDetect(device, detector) # device = 'cpu' or 'cuda', detector = 'dlib' or 'sfd'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/liguoqing/work/photo2cartoon/utils/face_detect.py", line 10, in init
self.fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device=device, face_detector=detector)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/liguoqing/.pyenv/versions/3.11.7/lib/python3.11/enum.py", line 784, in getattr
raise AttributeError(name) from None
AttributeError: _2D

It is possible to change _2D to TWO_D, which is effective in my environment.