Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

Implements CompreFace as a face detection backend for DoubleTake in the NVR stack.

Services Added

  • CompreFace (exadel/compreface:latest) - Face recognition API on port 8000
  • PostgreSQL (postgres:15) - CompreFace database backend
  • DoubleTake pre-configured via environment variables to use CompreFace detector

Configuration

secrets.env-example

COMPREFACE_PORT=8000
COMPREFACE_API_KEY=<auto-generated-64-char>
COMPREFACE_HOSTNAME=compreface
POSTGRES_USER=compreface_admin
POSTGRES_PASSWORD=<auto-generated-64-char>
POSTGRES_DB=compreface

startup.sh

  • Added compreface_postgres and compreface to SERVICE_NAMES (ordered for dependency resolution)
  • Added compreface_db_data and compreface_data volumes
  • DoubleTake container now includes: -e DETECTORS__COMPREFACE__URL=http://compreface:8080 -e DETECTORS__COMPREFACE__KEY=${COMPREFACE_API_KEY}
  • Nginx proxy configuration for CompreFace UI access
  • Services only start in NVR mode (nvr_only or iot_nvr)

Setup Flow

  1. Stack starts with placeholder API key
  2. User creates recognition service in CompreFace UI
  3. Real API key replaces placeholder in secrets.env
  4. Restart DoubleTake: ./startup.sh start doubletake

Notes

  • CompreFace requires 2-4GB RAM (8GB total for NVR stack recommended)
  • PostgreSQL must start before CompreFace (enforced via SERVICE_NAMES ordering)
  • TZ variable format fixed to avoid inline comment parsing issues
Original prompt

Implement support for CompreFace in the stack to enable DoubleTake to perform face detection. Update any relevant configuration, compose files, scripts, or documentation as necessary to add CompreFace as a service and integrate it with DoubleTake, using recommended settings where possible. Ensure the stack launches with CompreFace, and instructions or automation for its integration are clear.

This pull request was created as a result of the following prompt from Copilot chat.

Implement support for CompreFace in the stack to enable DoubleTake to perform face detection. Update any relevant configuration, compose files, scripts, or documentation as necessary to add CompreFace as a service and integrate it with DoubleTake, using recommended settings where possible. Ensure the stack launches with CompreFace, and instructions or automation for its integration are clear.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add support for CompreFace in DoubleTake stack Add CompreFace face detection service with DoubleTake integration Nov 24, 2025
Copilot AI requested a review from Stolas November 24, 2025 10:39
Copilot finished work on behalf of Stolas November 24, 2025 10:39
@Stolas
Copy link
Owner

Stolas commented Nov 24, 2025

@copilot as compreface needs postgresql also spin this up in NVR ONLY.

Copy link
Contributor Author

Copilot AI commented Nov 24, 2025

@copilot as compreface needs postgresql also spin this up in NVR ONLY.

This is already implemented. Both compreface_postgres and compreface services are configured to only start in NVR mode (nvr_only and iot_nvr). They are automatically skipped when running in iot_only mode.

The logic in startup.sh (lines 867-876 and 878-882) ensures:

  • ✅ Both services skip in IoT-only mode
  • ✅ Both services start in NVR-only mode
  • ✅ Both services start in Both (IoT+NVR) mode

Documentation in README.md also reflects this under "NVR only" configuration and the components table notes "NVR modes only" for CompreFace.

Copilot finished work on behalf of Stolas November 24, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants