Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,20 +1,43 @@
|
|
| 1 |
---
|
| 2 |
title: FacialKeypointDetectionCNN
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
tags:
|
| 9 |
-
- streamlit
|
| 10 |
pinned: false
|
| 11 |
short_description: 'Predict facial keypoints from an uploaded face image '
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: FacialKeypointDetectionCNN
|
| 3 |
+
emoji: π
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
app_file: src/streamlit_app.py
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
short_description: 'Predict facial keypoints from an uploaded face image '
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# π Facial Keypoints Detection (CNN)
|
| 14 |
|
| 15 |
+
This app predicts **facial keypoints** (eyes, eyebrows, nose, mouth) from a face image.
|
| 16 |
|
| 17 |
+
## What this project does
|
| 18 |
+
- Input: face image (grayscale or RGB)
|
| 19 |
+
- Output: 30 values (x/y coordinates for 15 facial keypoints)
|
| 20 |
+
- The app overlays keypoints on a **96Γ96** image and shows the coordinates in a table.
|
| 21 |
+
|
| 22 |
+
## Files in this repo
|
| 23 |
+
- `app.py` β Streamlit app
|
| 24 |
+
- `final_keypoints_cnn.keras` β trained Keras model
|
| 25 |
+
- `target_cols.json` β output column names (order of the 30 targets)
|
| 26 |
+
- `preprocess_config.json` β preprocessing settings (image size, normalization)
|
| 27 |
+
|
| 28 |
+
## How to run locally
|
| 29 |
+
```bash
|
| 30 |
+
pip install -r requirements.txt
|
| 31 |
+
streamlit run app.py
|
| 32 |
+
Preprocessing (same as training)
|
| 33 |
+
Convert to grayscale
|
| 34 |
+
|
| 35 |
+
Resize to 96Γ96
|
| 36 |
+
|
| 37 |
+
Normalize pixels: x / 255.0
|
| 38 |
+
|
| 39 |
+
Model predicts normalized coordinates
|
| 40 |
+
|
| 41 |
+
Convert back to pixel space: y = y * 48 + 48
|
| 42 |
+
|
| 43 |
+
Clip to valid range: [0, 96]
|