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: 'numpy.float64' object cannot be interpreted as an index #5

Open
mohanrajmit opened this issue Feb 15, 2017 · 5 comments
Open

Comments

@mohanrajmit
Copy link

mohanrajmit commented Feb 15, 2017

error

@DuinoDu
Copy link
Owner

DuinoDu commented Feb 15, 2017

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

may help.

@mohanrajmit
Copy link
Author

face detection

@runhani
Copy link

runhani commented Mar 2, 2017

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]

@DuinoDu
Copy link
Owner

DuinoDu commented Mar 2, 2017

Much thanks!

@poojithareddy638
Copy link

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?

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

4 participants