8000 GitHub - Sang-Buster/Sober-Scan: A CLI tool that detects alcohol intoxication and drowsiness from facial images.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sang-Buster/Sober-Scan

Repository files navigation

logo

Sober Scan

Ask DeepWiki PyPI License uv Ruff Last Commit
A CLI tool that detects alcohol intoxication and drowsiness from facial images.

#Alcohol Intoxication   #Facial Recognition   #CLI


Demo GIF Test Image 1
Test Image 2

🚀 Getting Started

It is recommended to use uv to create a virtual environment and pip install the following package.

pip install sober-scan

To run the application, simply type:

sober-scan
# or
sober-scan --help

👨‍💻 Development Setup

  1. Clone the repository and navigate to project folder:

    git clone https://github.com/Sang-Buster/Sober-Scan
    cd Sober-Scan
  2. Install uv first:

    # macOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    # Windows
    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  3. Create a virtual environment at Sober-Scan/.venv/:

    uv venv --python 3.10
  4. Activate the virtual environment:

    # macOS/Linux
    source .venv/bin/activate
    # Windows
    .venv\Scripts\activate
  5. Install the required packages:

    uv pip install -e .
  6. Install ruff and pre-commit:

    uv pip install ruff pre-commit
    • ruff is a super fast Python linter and formatter.
    • pre-commit helps maintain code quality by running automated checks before commits are made.
  7. Install git hooks:

    pre-commit install --hook-type commit-msg --hook-type pre-commit --hook-type pre-push

    These hooks perform different checks at various stages:

    • commit-msg: Ensures commit messages follow the conventional format
    • pre-commit: Runs Ruff linting and formatting checks before each commit
    • pre-push: Performs final validation before pushing to remote
  8. Code Linting:

    ruff check
    ruff check --fix
    ruff check --select I
    ruff check --select I --fix
    ruff format
  9. Run the application:

    uv run src/sober_scan/cli.py

📝 File Str 6BC8 ucture

📂Sober-Scan
 ┣ 📂src                         // Source Code
 ┃ ┗ 📦sober_scan                  // Python package
 ┃ ┃ ┣ 📂commands                      // Command line interface
 ┃ ┃ ┃ ┣ 📄detect.py
 ┃ ┃ ┃ ┣ 📄model.py
 ┃ ┃ ┃ ┗ 📄train.py
 ┃ ┃ ┣ 📂models                        // Model files
 ┃ ┃ ┃ ┣ 📄cnn.py
 ┃ ┃ ┃ ┣ 📄knn.py
 ┃ ┃ ┃ ┣ 📄nb.py
 ┃ ┃ ┃ ┣ 📄rf.py
 ┃ ┃ ┃ ┗ 📄svm.py
 ┃ ┃ ┣ 📂tests                         // Test files
 ┃ ┃ ┃ ┗ 📄test_cli.py
 ┃ ┃ ┣ 📄cli.py                        // CLI interface
 ┃ ┃ ┣ 📄config.py                     // Configuration
 ┃ ┃ ┣ 📄feature_extraction.py         // Feature extraction
 ┃ ┃ ┗ 📄utils.py                      // Utility functions
 ┣ 📄.gitignore                  // Git ignore patterns (env, cache, database)
 ┣ 📄.pre-commit-config.yaml     // Pre-commit hooks (ruff, commit message)
 ┣ 📄.pre-commit_msg_template.py // Commit message format validator
 ┣ 📄.python-version             // Python version
 ┣ 📄LICENSE                     // MIT License
 ┣ 📄README.md                   // Project documentation
 ┣ 📄pyproject.toml              // Project configuration
 ┗ 📄uv.lock                     // Lock file

About

A CLI tool that detects alcohol intoxication and drowsiness from facial images.

Topics

Resources

License

Stars

Watchers

Forks

Languages

0