I installed the mtcnn package, as can be seen:
# confirm mtcnn was installed correctly
import mtcnn
# print version
print(mtcnn.__version__)
Result:
0.0.9
Then I use the following:
# 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']
Result:
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