Skip to content

FacePlatform enhances home security by capturing, tagging, and notifying you of faces detected by your home cameras in real-time.

License

Notifications You must be signed in to change notification settings

nivg1992/faceplatform

Repository files navigation

FacePlatform

FacePlatform is a powerful tool designed to enhance your home security system by utilizing your home cameras. It captures snapshots, tags faces, and sends pictures along with identification information. With FacePlatform, you can keep track of who is coming and going in real-time.

Features

  • Snapshot Capture: Takes snapshots from your home cameras automatically.
  • Face Tagging: Detects and tags faces in the snapshots.
  • Notification System: Sends a picture of the face along with identification details.

Getting Started

Prerequisites

Ensure you have the following prerequisites before installing FacePlatform:

  • Python 3.10+
  • go2rtc server An easy way to get started is by pulling the Docker image and running it with a configuration like this:
    streams:
       camera: rtsp://127.0.0.1/token
    
  • cmake Download and install the relevant binary
  • ffmpeg
       apt install ffmpeg
  • node22

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/faceplatform.git
    cd faceplatform
  2. Install the required dependencies:

    poetry install
  3. Configure your camera settings and identification details in cameras.json

    [
       {
         "type": "mqtt_trigger",
         "mqtt_host": "127.0.0.1",
         "mqtt_port": 1883,
         "mqtt_user": "user",
         "mqtt_password": "password",
         "cameras": [
             {
                 "name": "camera1",
                 "topic": "camera_topic",
                 "stream_protocol": "rtsp",
                 "stream_url": "rtsp://127.0.0.1/aa"
             }
         ]
       },
       {
         "type": "unifi", // required  
         "host": "192.168.1.1",  // required
         "user": "myUnifiUser",  // required
         "password": "myPassword",  // required
         "image_quality": "HIGH",  // optional, default: LOW
         "skip_ssl_check": false,  // optional, default: true
         "exclude_cameras": ["kitchen"]   // optional, default: []
      }
    ]

Build with Docker

docker build . -t faceplatform

Running the Application

python -m "src.main"

Docker Compose

services:
 faceplatform:
   image: nivg1992/faceplatform
   ports:
     - 5000:5000
   environment:
     - PF_DATA_FOLDER=/data
   volumes:
     - ./cameras.json:/app/cameras.json
     - ./data:/data

Add new input

  1. Create input file: add an input file at src/inputs

  2. Subclass Input: Begin by subclassing the Input abstract class to define your custom input source. Implement the required methods for initialization, configuration, stream management, event handling, and data capture.

  3. Utilize Events Management: Use the events_manager property inherited from Input to manage events and start/stop data capture from specific topics or cameras using start_capture_topic and stop_capture_topic.

  4. Add to input_manager: After defining your input source, add it to the input_manager of FacePlatform using the add_input function. This step ensures that your input source is registered and can be accessed and controlled centrally within the application.

  5. Testing and Integration: Test your input source thoroughly to ensure compatibility and seamless integration with FacePlatform’s existing components. Refer to provided examples and documentation for assistance.

License

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

About

FacePlatform enhances home security by capturing, tagging, and notifying you of faces detected by your home cameras in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •