1 问题描述
运行retalking模型时,代码抛出异常,信息如下所示:
Traceback (most recent call last):
File "D:/ml/video-retalking/inference.py", line 345, in <module>
main()
File "D:/ml/video-retalking/inference.py", line 81, in main
kp_extractor = KeypointExtractor()
File "D:\ml\video-retalking\third_part\face3d\extract_kp_videos.py", line 16, in __init__
self.detector = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D)
File "D:\.conda\retalking\lib\enum.py", line 384, in __getattr__
raise AttributeError(name) from None
AttributeError: _2D
2 问题分析
从异常信息可知,在face_alignment.LandmarksType中没有_2D这个属性,查看face_alignment.LandmarksType源代码,如下所示:
class LandmarksType(IntEnum):
"""Enum class defining the type of landmarks to detect.
``TWO_D`` - the detected points ``(x,y)`` are detected in a 2D space and follow the visible contour of the face
``TWO_HALF_D`` - this points represent the projection of the 3

文章讲述了在运行视频重述模型时遇到的FaceAlignment异常,原因在于LandmarksType中没有_2D属性。给出了两种解决方案:直接替换为TWO_D常量或升级face_alignment库。同时介绍了Conda环境管理器在包管理和依赖性问题上的优势和用法。

3872

被折叠的 条评论
为什么被折叠?



