Spaces:
Sleeping
Sleeping
Download src/model_code/emotion_model.py from JEPHONETORRE/FINALPROJ: direct link, hf CLI and curl.
- Browser
- Download file 609 Bytes
-
https://huggingface.co/spaces/JEPHONETORRE/FINALPROJ/resolve/main/src/model_code/emotion_model.py
- Command line
-
hf download hf://spaces/JEPHONETORRE/FINALPROJ/src/model_code/emotion_model.py
-
curl -L -o emotion_model.py https://huggingface.co/spaces/JEPHONETORRE/FINALPROJ/resolve/main/src/model_code/emotion_model.py
609 Bytes
| 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 | |