def main(img_dir): img = get_img(img_dir).astype('float32') img /= 255. # Getting model: model_file = open('Data/Model/model.json', 'r') model = model_file.read() model_file.close() model = model_from_json(model) # Getting weights model.load_weights("Data/Model/weights.h5") Y = predict(model, img) name = 'segmentated.jpg' save_img(Y, name) print('Segmentated image saved as ' + name)
def save_event_mouse(data_path, x, y): data_path = data_path + '/{0},{1},0,0'.format(x, y) screenshot = get_screenshot() save_img(data_path, screenshot) return
def save_event_keyboard(data_path, event, key): key = get_id(key) data_path = data_path + '/-1,-1,{0},{1}'.format(event, key) screenshot = get_screenshot() save_img(data_path, screenshot) return