nivg1992 / faceplatform

FacePlatform enhances home security by capturing, tagging, and notifying you of faces detected by your home cameras in real-time.
Apache License 2.0
4 stars 1 forks source link
deepface face face-recognition machine-learning platform python

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

Getting Started

Prerequisites

Ensure you have the following prerequisites before installing FacePlatform:

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.