Spaces:
Sleeping
Sleeping
File size: 609 Bytes
e55378f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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
|