FINALPROJ / src /model_code /emotion_model.py
Jephone Israel Jireh S. Torre
1st push
e55378f
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout
def build_model():
model = Sequential([
Conv2D(32, (3,3), activation='relu', input_shape=(48,48,1)),
MaxPooling2D(2,2),
Conv2D(64, (3,3), activation='relu'),
MaxPooling2D(2,2),
Flatten(),
Dense(128, activation='relu'),
Dropout(0.5),
Dense(7, activation='softmax') # Adjust number if different emotions
])
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
return model