Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def loadImages(partition,imagepath):
- totalImages = len(imagepath)
- for i in range(totalImages):
- if i > (partition*20)*totalImages/100 or i < (((partition-1)*20))*totalImages/100:
- image = Image.open(imagepath[i])
- trainData.append(numpy.array(image).flatten())
- trainLabel.append(imagepath[i].split("/")[6].split(".")[0])
- else:
- image = Image.open(imagepath[i])
- testData.append(numpy.array(image).flatten())
- testLabel.append(imagepath[i].split("/")[6].split(".")[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement