Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created October 10, 2020 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/a8f5fc217fdaddb0072402bedcd16d3d to your computer and use it in GitHub Desktop.
Save amankharwal/a8f5fc217fdaddb0072402bedcd16d3d to your computer and use it in GitHub Desktop.
def img2vector(filename):
returnVect = zeros((1,1024))
fr = open(filename)
for i in range(32):
lineStr = fr.readline()
for j in range(32):
returnVect[0,32*i+j] = int(lineStr[j])
return returnVect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment