Skip to content

virtualbeck/trichshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrichShot

A real-time hand detection system that helps prevent trichotillomania (hair-pulling) episodes by providing visual warnings when hands approach the face area. Features smart camera detection, external camera prioritization, and performance optimizations for various hardware configurations.

TrichShot Demo Python Docker License

Features

Core Functionality

  • Real-time hand detection using MediaPipe
  • Visual warning system with full-screen overlay
  • Customizable danger zones for face area detection
  • Session statistics and monitoring
  • Multi-threaded processing with resource management

Smart Camera Detection

  • Automatic camera discovery and classification
  • External camera prioritization over integrated cameras
  • Camera type identification (USB, Logitech, etc.)

Quick Start

Prerequisites

  • Docker installed on your system
  • X11 forwarding support (Linux/macOS)
  • At least one camera connected to your system
  • Camera permissions properly configured

Installation & Running

  1. Clone the repository:

    git clone https://github.com/virtualbeck/trichshot.git
    cd trichshot
  2. Build the Docker image:

    docker build -t trichshot:latest .
  3. Make the run script executable; Run:

    chmod +x run_trichshot.sh
    ./run_trichshot.sh

Usage

Starting the Application

The application provides a comprehensive GUI for configuration and monitoring:

  1. Camera Selection: Choose from automatically detected cameras
  2. Detection Configuration: Customize danger zone areas
  3. Session Monitoring: Track warnings and session time

GUI Controls

  • Start/Stop Monitoring: Begin or end the detection session
  • Camera Selection: Switch between available cameras
  • Refresh Cameras: Re-detect available cameras
  • Danger Zone Sliders: Adjust the detection area

Configuration

Camera Setup

The application automatically detects and prioritizes cameras in this order:

  1. External USB cameras (Logitech, Microsoft, Creative, etc.)
  2. Unknown cameras with index > 0
  3. Integrated laptop cameras

Danger Zone Configuration

  • Top Slider: Adjusts the upper boundary of the detection zone
  • Bottom Slider: Adjusts the lower boundary of the detection zone

Privacy & Security

  • Local Processing: All detection happens locally, no data sent externally
  • No Recording: Frames are processed in memory and not stored
  • Minimal Permissions: Docker container runs with least-privilege access
  • Camera Access: Only accesses cameras you explicitly grant access to

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with appropriate tests
  4. Submit a pull request

Reporting Issues

When reporting issues, please include:

  • System specifications (OS, CPU, RAM)
  • Camera information (model, type)
  • Performance mode used
  • Error messages or logs
  • Steps to reproduce

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • MediaPipe team for the excellent hand detection framework
  • OpenCV community for computer vision tools
  • Docker for containerization platform
  • Contributors and users who provide feedback and improvements

Support


Disclaimer: TrichShot is a tool designed to assist with awareness of hand-to-face movements. It is not a medical device and should not replace professional medical advice or treatment. If you're struggling with trichotillomania or similar conditions, please consult with a healthcare professional.

Also, TrichShot was vibe-coded into existence. I'm putting this out there after I spent a few hours tweaking it. It has greatly minimized my compulsion to twist/pull while at the computer, and I'm already seeing positive results away from the computer. Hopefully this will be a positive reinforcement loop that can help me (and you!) to alleviate this impulse control disorder.

About

TrichShot: Help prevent trichotillomania (hair-pulling) episodes by providing visual warnings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published