Skip to content

Conversation

@ravicoder01
Copy link

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.

      📊 Post-drive Analysis: Data can be reviewed later for improving driver awareness and safety measures.

      📥 Easy Reporting: Since the log is stored in a CSV, it can be directly opened in Excel or Google Sheets for reporting and analysis.

📌 (This log file can be shared with fleet managers or safety officers to monitor driver fatigue patterns.)

@ravicoder01
Copy link
Author

Hii @Gagandeep-2003 PR is ready to be reviewed let me know if any changes are required.

@Gagandeep-2003
Copy link
Owner

Gagandeep-2003 commented Aug 1, 2025

@ravicoder01 This blinkDetect.py file is having a conflict. Kindly resolve it. Also mention which issue it is resolving.

@ravicoder01
Copy link
Author

@Gagandeep-2003 conflicts has been resolved please review

Copy link
Owner

@Gagandeep-2003 Gagandeep-2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Problems Identified

  1. Model Incompatibility

    • The facial landmark model was changed from 70 points to 68 points (shape_predictor_70_face_landmarks.datshape_predictor_68_face_landmarks.dat).
    • This change will break compatibility with existing code and pre-trained models.
  2. Hardcoded Paths

    • Python executable paths are hardcoded as venv\Scripts\python.exe, which may not work on all systems or OS environments.
  3. 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.
  4. 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

  1. Model

    • Revert to the original 70-landmark model to ensure backward compatibility with the existing codebase.
  2. Path Handling

    • Use sys.executable to dynamically reference the current Python interpreter, instead of hardcoded paths.
  3. Code Structure

    • Add CSV logging as an additional feature, avoiding major rewrites to the core detection logic.
  4. Binary Files

    • Remove all large binary/model/video files from the PR.
    • Instead, provide download instructions or maintain a models/README.md with model links.
  5. Documentation

    • Update the documentation or README.md to mention the new CSV logging feature and include usage instructions.

@ravicoder01
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants