Skip to content

Latest commit

 

History

History
91 lines (68 loc) · 2.35 KB

File metadata and controls

91 lines (68 loc) · 2.35 KB

Security Camera System

A face recognition-based security system for Linux that monitors and controls access through your computer's camera.

Installation Guide for Linux

Prerequisites

  1. Install system dependencies:
sudo apt-get update
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl \
git cmake libopencv-dev

Setting up Python Environment

  1. Install pyenv (if not already installed):
curl https://pyenv.run | bash
  1. Add pyenv to your shell configuration (~/.bashrc or ~/.zshrc):
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
  1. Reload your shell configuration:
source ~/.bashrc
  1. Install Python 3.11.0:
pyenv install 3.11.0
  1. Create a virtual environment for the project:
cd to/the/folder/you/want/to/clone/security-script
pyenv local 3.11.0
python -m venv .venv
source .venv/bin/activate

Installing the Project

  1. Clone the repository:
git clone <repository-url>
cd security-script
  1. Install required Python packages:
pip install -r requirements.txt

Running the Application

  1. Add authorized face images to the database1 directory (supported formats: .jpg, .jpeg, .png)

  2. Run the security camera system:

python security_linux.py

Usage Notes

  • The system will create an unknown_faces directory to store detected unauthorized faces
  • Logs are stored in security_system.log
  • Press 'q' to quit the application
  • The system will automatically log out the current user if an unauthorized face is detected in consecutive frames

Code Structure

The main script security_linux.py is structured to be self-documenting with clear variable names and logical organization. Key components include:

  • Face detection and recognition using the face_recognition library
  • Real-time camera feed processing with OpenCV
  • Automatic logging of security events
  • Force logout capability for unauthorized access
  • Support for toggling camera feed visibility

License

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