Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in extract_image_chips #57

Open
Morceguito opened this issue Mar 23, 2021 · 2 comments
Open

TypeError in extract_image_chips #57

Morceguito opened this issue Mar 23, 2021 · 2 comments

Comments

@Morceguito
Copy link

File "main.py", line 22, in
chips = detector.extract_image_chips(img, points, 144, 0.37)
File "/content/drive/My Drive/mxnet_mtcnn_face_detection-master/mtcnn_detector.py", line 484, in extract_image_chips
for k in range(len(p)/2):
TypeError: 'float' object cannot be interpreted as an integer

I didn't change anything besides switching izip to zip

@naserpiltan
Copy link

Hey
I solved this problem. Change these lines in mtcnn_detector.py as followings :
line 431 : change reshape(from_shape.shape[0]/2, 2) to reshape(int(from_shape.shape[0]/2), 2)
line 432 : change to_shape.reshape(to_shape.shape[0]/2, 2) to to_shape.reshape(int(to_shape.shape[0]/2), 2)
line 485 : change range(len(p)/2) to range(int(len(p)/2))
line 500 : range(len(shape)/2) to range(int(len(shape)/2))

In summary put an int before the devisions.

@dreamlychina
Copy link

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants