Skip to main content

A CLI tool that detects alcohol intoxication from facial images.

Project description

logo

Sober Scan

Ask DeepWiki PyPI License uv Ruff Downloads 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 Structure

📂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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sober_scan-0.0.4.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sober_scan-0.0.4-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file sober_scan-0.0.4.tar.gz.

File metadata

  • Download URL: sober_scan-0.0.4.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for sober_scan-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0c7a72229fa7b37adc4364a2d93676a7b3fba3078f5c23c5d9ec4ba93baa913c
MD5 9f8992357107cbb38122d6cbda10e7c0
BLAKE2b-256 890a105af866c5a57ead555e8f35a2986e98ca92e3052a023da69964c32768ea

See more details on using hashes here.

File details

Details for the file sober_scan-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: sober_scan-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for sober_scan-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b45a25c22206691763951fdba8341d1bda541f6c23a143e615c3c41daa15eff
MD5 a39cb24b09b0ad88e65d6da272e49617
BLAKE2b-256 494c895cef7801713bf8fb53355052c4052a1af16e1641e9d4736d69ed7bf7a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page