Created
June 16, 2018 09:59
-
-
Save shihyu/a56fb45dfb7781a48bcb7199cad25a0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Model | |
from keras.layers import Input, Dense, Dropout, Flatten, Conv2D, MaxPooling2D, BatchNormalization | |
from keras.callbacks import ModelCheckpoint, EarlyStopping, TensorBoard | |
from PIL import Image | |
import numpy as np | |
import csv | |
in1 = Input((60, 200, 3)) | |
print("Reading training data...") | |
traincsv = open('./data/56_imitate_train_set/len_train.csv', 'r', encoding = 'utf8') | |
''' | |
for row in csv.reader(traincsv): | |
tmp = [np.array(Image.open("./data/56_imitate_train_set/" + '{0:05}'.format(int(row[0])) + ".jpg"))/255.0] | |
train_data = np.stack(tmp) | |
''' | |
train_data = np.stack([np.array(Image.open("./data/56_imitate_train_set/" + '{0:05}'.format(int(row[0])) + ".jpg"))/255.0 for row in csv.reader(traincsv)]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment