Added CSV logging for drowsy detection with duration tracking#58
Added CSV logging for drowsy detection with duration tracking#58ravicoder01 wants to merge 2 commits into
Conversation
|
Hii @Gagandeep-2003 PR is ready to be reviewed let me know if any changes are required. |
|
@ravicoder01 This blinkDetect.py file is having a conflict. Kindly resolve it. Also mention which issue it is resolving. |
|
@Gagandeep-2003 conflicts has been resolved please review |
Gagandeep-2003
left a comment
There was a problem hiding this comment.
Problems Identified
-
Model Incompatibility
- The facial landmark model was changed from 70 points to 68 points (
shape_predictor_70_face_landmarks.dat→shape_predictor_68_face_landmarks.dat). - This change will break compatibility with existing code and pre-trained models.
- The facial landmark model was changed from 70 points to 68 points (
-
Hardcoded Paths
- Python executable paths are hardcoded as
venv\Scripts\python.exe, which may not work on all systems or OS environments.
- Python executable paths are hardcoded as
-
Unnecessary Code Rewrites
- Large sections of working code (131 lines) were rewritten, rather than extending the current logic.
- This makes the PR hard to review and introduces unnecessary merge risk.
-
Large Binary Files in PR
-
Model and video files (
.dat,.avi) totaling over 100MB have been added to the repository.- This is not recommended. Binary/model files should not be tracked in source control.
- Best practice is to use GitHub Releases or external storage for these assets.
-
Suggestions to Fix
-
Model
- Revert to the original 70-landmark model to ensure backward compatibility with the existing codebase.
-
Path Handling
- Use
sys.executableto dynamically reference the current Python interpreter, instead of hardcoded paths.
- Use
-
Code Structure
- Add CSV logging as an additional feature, avoiding major rewrites to the core detection logic.
-
Binary Files
- Remove all large binary/model/video files from the PR.
- Instead, provide download instructions or maintain a
models/README.mdwith model links.
-
Documentation
- Update the documentation or
README.mdto mention the new CSV logging feature and include usage instructions.
- Update the documentation or
|
Hey @Gagandeep-2003 , I noticed code expects shape_predictor_70_face_landmarks.dat, but README lists the 68-point model. I’ve searched but couldn’t find the 70‑point version. Could you please share it or allow me to update code for 68‑point model? |
This PR enhances the Driver Drowsiness Detection System by adding automatic CSV logging whenever drowsiness is detected.
🔥 What’s New
✅ Automatic CSV file creation (blink_log.csv) – Stores important data whenever the system detects the driver is drowsy.
✅ Logs these details:
📅 Date – When drowsiness was detected
⏰ Time – Exact timestamp
🛑 Status – Shows “Drowsy”
⏳ Duration (sec) – How long the driver’s eyes remained closed
✅ Data is only logged when drowsiness is detected (avoids unnecessary entries).
💡 Why this helps
🚗 Safety Tracking: Helps analyze how often a driver becomes drowsy.
📌 (This log file can be shared with fleet managers or safety officers to monitor driver fatigue patterns.)