Skip to content

Commit 33f6b59

Browse files
Merge pull request Gagandeep-2003#48 from debug-soham/docs/add-model-download-instructions
Merged PR to improve documentation and setup clarity. Added mandatory model download instructions in README and CONTRIBUTING, updated blinkDetect.py with correct model path and comments to help new users avoid RuntimeError. Fixes Gagandeep-2003#45.
2 parents 7dff9c3 + 9599e59 commit 33f6b59

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ First off, thank you for considering contributing to this project! Your help is
88

99
## 🛠️ Project Setup
1010
Follow these steps to get the project running on your local machine.
11+
1112
### 1. **Fork and Clone**
1213
1. **Fork the repository**: Click the `Fork` button on the top right of the repo.
1314
2. **Clone your fork**:
@@ -35,8 +36,9 @@ Follow these steps to get the project running on your local machine.
3536
```bash
3637
pip install -r requirements.txt
3738
```
38-
39-
3. **Download the dlib model**: The blink detection feature requires a pre-trained model.
39+
40+
3. **Download the dlib facial landmark model**
41+
The blink detection feature requires a pre-trained model.
4042
* Download the file from [this link](https://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2).
4143
* Unzip it and place the `shape_predictor_68_face_landmarks.dat` file inside the `/models` directory.
4244

@@ -73,6 +75,7 @@ Follow these steps to get the project running on your local machine.
7375
* Keep your code clean, readable, and well-commented where necessary.
7476
* Follow the existing naming conventions and code style.
7577
* Ensure each pull request addresses only one feature or bug fix.
78+
* Comment your code where needed.
7679
7780
## 🙌 Need Help?
7881

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ source venv/bin/activate # On Windows: venv\Scripts\activate
5555
```bash
5656
pip install -r requirements.txt
5757
```
58-
3. **Run the application:**
58+
3. **Download the model:**
59+
60+
The dlib facial landmark model is required for blink detection. Download it from the link below, unzip it, and place the `shape_predictor_68_face_landmarks.dat` file inside the `/models` directory.
61+
* **Download Link**: [shape_predictor_68_face_landmarks.dat](https://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2)
62+
63+
4. **Run the application:**
5964
```bash
6065
python main.py
6166
```

blinkDetect.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
RESIZE_HEIGHT = 460
2121

2222
thresh = 0.27
23-
modelPath = "models/shape_predictor_70_face_landmarks.dat"
23+
24+
# IMPORTANT: You must download the shape_predictor_68_face_landmarks.dat file from
25+
# https://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
26+
# and place it in the 'models' folder
27+
modelPath = "models/shape_predictor_68_face_landmarks.dat"
2428
sound_path = "alarm.wav"
2529

2630
detector = dlib.get_frontal_face_detector()

0 commit comments

Comments
 (0)