Skip to content

Instantly share code, notes, and snippets.

@vadimostanin
vadimostanin / keras for juggling
Created December 5, 2017 16:01 — forked from smeschke/keras for juggling
predict juggling patterns using keras
import numpy as np, os, cv2
from keras.utils import to_categorical
from keras.models import load_model
#reads images from folder (images must be labeled 0.png, 1.png, etc...)
def read_from_folder(folder, pattern, image_number, stop):
images = []
while image_number < stop:
path = folder + pattern + '/' + str(image_number) + '.png'
img = cv2.imread(path, 0)