我安装了mtcnn软件包,如下所示:
# confirm mtcnn was installed correctly
import mtcnn
# print version
print(mtcnn.__version__)
结果:
0.0.9
然后我使用以下内容:
# prepare model
model = MTCNN()
# detect face in the image
faces = model.detect_faces(pixels)
# extract details of the face
x1, y1, width, height = faces[0]['box']
结果:
1 # prepare model
----> 2 model = MTCNN()
3 # detect face in the image
4 faces = model.detect_faces(pixels)
5 # extract details of the face
NameError: name 'MTCNN' is not defined
答案 0 :(得分:2)
文档是一个不错的起点:https://github.com/ipazc/mtcnn
WARN admin.RepoDumpJob - Backup skipped: A backup for
repo 'ProjectsNew' is already running, as indicated by
prior existence of progress log
'C:\csvn\data\logs\temp\job-progress-ProjectsNew-dump.log'
答案 1 :(得分:1)
有时人们所做的就是将他们正在处理的文件命名为mtcnn.py,这会导致此错误。将文件mtcnn.py的名称更改为其他名称即可。