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

How to convert the preprocessed bin file to Numpy data? #15

Closed
ecvgit opened this issue Apr 26, 2018 · 2 comments
Closed

How to convert the preprocessed bin file to Numpy data? #15

ecvgit opened this issue Apr 26, 2018 · 2 comments

Comments

@ecvgit
Copy link

ecvgit commented Apr 26, 2018

I am wondering how the preprocessed bin data was converted to Numpy (28x28) data?

In the Numpy data, I see that each location has a value between 0 and 255 (not just 1). How was this value arrived at? I thought the original stroke data contained only x and y coordinates and for each such x,y coordinate, we make a 1? But this does not seem to be the case. Is there a pointer to any algorithm to convert the stroke data to the numpy array?

@enjalot
Copy link
Collaborator

enjalot commented Apr 30, 2018

The bin data is basically a rendered image of the drawings. The values are 0 to 255 because that is a common way to store 8bit color data.
So if you scale the x,y coordinates to 28x28 and render and plot the lines onto an image you should get something similar.

@HalfdanJ
Copy link
Contributor

HalfdanJ commented Jul 3, 2018

I've pasted the full function here: #19 (comment)

@HalfdanJ HalfdanJ closed this as completed Jul 3, 2018
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