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

Reshape on train_data is mixing the pixels! #63

Closed
giordand opened this issue Aug 9, 2017 · 5 comments
Closed

Reshape on train_data is mixing the pixels! #63

giordand opened this issue Aug 9, 2017 · 5 comments

Comments

@giordand
Copy link

giordand commented Aug 9, 2017

The reshape to the train data and also to the screen grabbed on testing model is mixing the pixels in the screen:

image

the solution is to change width by height in every line where is a reshape, as in

X = np.array([i[0] for i in train]).reshape(-1,WIDTH,HEIGHT,3)

X = np.array([i[0] for i in train]).reshape(-1,WIDTH,HEIGHT,3)

by:

X = np.array([i[0] for i in train]).reshape(-1,HEIGHT,WIDTH,3)

and now reshape is OK:

image

@germanmarky
Copy link

Confirmed issue and fix.

@Eric-Ryan
Copy link

prev = cv2.resize(screen, (WIDTH,HEIGHT))

screen = cv2.resize(screen, (WIDTH,HEIGHT))

prediction = model.predict([screen.reshape(WIDTH,HEIGHT,3)])[0]

Within '3.test_model.py' should I change these lines too? Did this fix the issue of only going straight?

@giordand
Copy link
Author

giordand commented Aug 9, 2017

This fix is no related with #62 ...at least with 25k examples for training, balanced....

@germanmarky
Copy link

@giordand I haven't had a chance to test, but good to know.

@Eric-Ryan do not change the resize functions as they are working as intended.

@DevJhns
Copy link

DevJhns commented Jun 11, 2018

@giordand how you get reshaped img?

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

5 participants