7b6fd231d17cd1fd88c1fc163a33f1049d63e7b0,examples/transferlearning_model.py,,,#,4

Before Change


data_loader = DataLoader(from_csv=True, emotion_map=fer_dataset_label_map, datapath=csv_file_path,
                         image_dimensions=raw_dimensions, csv_label_col=0, csv_image_col=1, out_channels=3)
dataset = data_loader.get_data()
labels = dataset.get_labels()
images = dataset.get_images()

if verbose:
    print("raw image shape: " + str(images.shape))

print("Creating training/testing data...")
validation_split = 0.15
X_train, X_test, y_train, y_test = train_test_split(images, labels,
                                                    test_size=validation_split, random_state=42, stratify=labels)
train_gen = DataGenerator().fit(X_train, y_train)
test_gen = DataGenerator().fit(X_test, y_test)

print("--------------- Inception-V3 Model -------------------")

After Change


from keras import backend as K
K.set_image_data_format("channels_last")

validation_split = 0.15
verbose = True
model_name = "inception_v3"

target_dimensions = (128, 128)
raw_dimensions = (48, 48)
fer_dataset_label_map = {"0": "anger", "2": "fear"}

print("--------------- Inception-V3 Model -------------------")
print("Loading data...")
csv_file_path = "image_data/sample.csv"
data_loader = DataLoader(from_csv=True, emotion_map=fer_dataset_label_map, datapath=csv_file_path, validation_split=validation_split,
                         image_dimensions=raw_dimensions, csv_label_col=0, csv_image_col=1, out_channels=3)
dataset = data_loader.load_data()

if verbose:
    dataset.print_data_details()

print("Creating training/testing data...")
train_images, train_labels = dataset.get_training_data()
train_gen = DataGenerator().fit(train_images, train_labels)
test_images, test_labels = dataset.get_test_data()
test_gen = DataGenerator().fit(test_images, test_labels)

print("Initializing neural network with InceptionV3 base model...")
model = TransferLearningNN(model_name=model_name, emotion_map=dataset.get_emotion_index_map())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 17

Instances


Project Name: thoughtworksarts/EmoPy
Commit Name: 7b6fd231d17cd1fd88c1fc163a33f1049d63e7b0
Time: 2018-04-26
Author: angelica.perez37@gmail.com
File Name: examples/transferlearning_model.py
Class Name:
Method Name:


Project Name: thoughtworksarts/EmoPy
Commit Name: 7b6fd231d17cd1fd88c1fc163a33f1049d63e7b0
Time: 2018-04-26
Author: angelica.perez37@gmail.com
File Name: examples/timedelay_conv_model.py
Class Name:
Method Name:


Project Name: thoughtworksarts/EmoPy
Commit Name: 7b6fd231d17cd1fd88c1fc163a33f1049d63e7b0
Time: 2018-04-26
Author: angelica.perez37@gmail.com
File Name: examples/convolutional_model.py
Class Name:
Method Name:


Project Name: thoughtworksarts/EmoPy
Commit Name: 7b6fd231d17cd1fd88c1fc163a33f1049d63e7b0
Time: 2018-04-26
Author: angelica.perez37@gmail.com
File Name: examples/convolutional_lstm_model.py
Class Name:
Method Name: