ModuleNotFoundError: No module named '

it2022-05-05  111

这是我原本的目录结构,我想在test_on_images中

from .detector import detect_faces

结果报了No module named '__main__.detector'; '__main__' is not a package

解决方法:将test_on_images移动到insightface文件夹的上一层,然后修改成

from insightface.detector import detect_faces

就ok了!

github参考链接

附一个InsightFace模型pytorch版的链接:https://github.com/TreB1eN/InsightFace_Pytorch/tree/master/mtcnn_pytorch


最新回复(0)