DuinoDu/mtcnn

TypeError: 'numpy.float64' object cannot be interpreted as an index

mohanrajmit opened this issue · 5 comments

tmp = np.zeros(( int(tmph[k]), int(tmpw[k]), 3))

may help.

Hello, Same Error happened to me.

I changed 4 lines. and then it's working!

In Line (343,350), (427,428)

tmp = np.zeros((tmph[k], tmpw[k],3))
tmp[dy[k]:edy[k]+1, dx[k]:edx[k]+1] = img[y[k]:ey[k]+1, x[k]:ex[k]+1]

change like below

tmp = np.zeros(( int(tmph[k]), int(tmpw[k]),3))
tmp[ int(dy[k]):int(edy[k])+1, int(dx[k]):int(edx[k])+1] = img[int(y[k]):int(ey[k])+1, int(x[k]):int(ex[k])+1]

Much thanks!

The thread 'MainThread' (0x1930) has exited with code 0 (0x0).
Traceback (most recent call last):
File "C:\Users\Administrator\source\repos\PythonApplication8\PythonApplication8\svmex.py", line 25, in
ymin, ymax= np.zeros(int(Y[:, 1].min()-1)), np.zeros(int(Y[:, 1].max()+1))
IndexError: too many indices for array

can anyone help me to solve this?