A privacy-focused, intelligent security camera system.

Overview

Self-Hosted Home Security Camera System

A privacy-focused, intelligent security camera system.

Features:

  • Multi-camera support w/ minimal configuration. Supports USB cameras and the Raspberry Pi camera module.
  • Motion detection that automatically saves videos and lets you view them in the web app.
  • Encrypted in transit, both from the cameras to the server and the server to your browser.
  • Self-Hosted
  • Free and Open Source

Example screenshots

Setting up the server

Docker:

  1. Clone this repository
  2. Generate SSL certificates: ./create-certs.sh. Alternatively, you may place your own certs in the certs dir
  3. Build and run the docker containers: API_URL=<server-hostname:server-port> docker-compose up -d --build. For example, if the API was running on the host sec-cam-server and port 8444, you should use API_URL=sec-cam-server:8444

Adding a camera

Installation:

NOTE: These instructions assume you are deploying to a raspberry pi running Raspbian OS.

  1. Install the python3-opencv package and dependencies: sudo apt-get install python3-opencv libatlas-base-dev
  2. Clone this repository
  3. Install the package: cd backend && python3 -m pip install .[streamer]. If you are using the Raspberry Pi camera module, run cd backend && python3 -m pip install .[streamer,picam].
  4. Update --server_url in run.sh to point at the host you deployed the server to.
  5. In the Web UI, you should see live video from that camera.
Comments
  • CORS error with self-signed certificates

    CORS error with self-signed certificates

    Some browsers like Firefox don't like cross-origin requests to URLs using self-signed certs even if you've already trusted certificate on the UI.

    Workaround:

    In the browser you're using, load an API endpoint (something like https://:8444/rooms) and go through the "this certificate can't be trusted" warning. Then, go back to the UI and refresh the page and see if its fixed.

    bug help wanted 
    opened by scottbarnesg 5
  • Run one system

    Run one system

    Can this be ran on all on one system with just a usb camera plugged in, and being able to serve the web user interface to localhost? Also, if so, would it all be in one container, or multiple? Thanks

    question 
    opened by neu-ma-tic 2
  • Add authentication

    Add authentication

    Currently, the UI is available to anyone with network access to the host. We need to develop or integrate an authentication solution to provide login capabilities.

    enhancement 
    opened by scottbarnesg 2
  • Fix CORS issue with self-signed certificates

    Fix CORS issue with self-signed certificates

    Changes:
    • Updates Flask server to serve React app.
    • Removes unused nginx config
    • Moves frontend container to an intermediate container in server
    • Updates default server port for both the UI and API to 8443
    Testing:
    • Check out this branch
    • Generate new (untrusted) certs: ./create-certs.sh
    • Start the server: docker-compose up -d --build
    • Open the Web UI in Firefox at https://localhost:8443. After clicking through the certificate warnings, open the debug console and verify there are no CORS errors.
    • Navigate to the videos page: https://localhost:8443/videos. Verify the videos load correctly and that there are no CORS errors in the debug console.

    Closes #16

    opened by scottbarnesg 1
  • Improve motion detection algorithm

    Improve motion detection algorithm

    Currently, the motion detection algorithm performs background subtraction on the incoming video frames to detection motion. This can cause "false positives", flagging motion that we don't care about (e.g. the wind blowing tree branches)

    This should be enhanced to identify more specific "objects of interest" (e.g. a person walking by).

    enhancement help wanted 
    opened by scottbarnesg 1
  • Run camera streamer code as a systemd service

    Run camera streamer code as a systemd service

    • Adds a base .service file for running streamer as a systemd service.
    • Adds create-streamer-service.sh to configure .service file for per-system installation.
    • Updates README.md with instructions on how to install streamer service under systemd.
    opened by scottbarnesg 0
  • Improve motion detection

    Improve motion detection

    Changes:

    • Replaces background-subtraction based motion detection with contour-based approach
    • Saved videos now have a box drawn around areas in which motion is detected
    • Adds --capture-delay argument to streamer.
    • Adds a size limit to the streamer's frame capture queue.

    Closes #5

    opened by scottbarnesg 0
  • Add authentication

    Add authentication

    Tasks:

    • [x] Implement authentication logic
    • [x] Add login endpoint
    • [x] Enforce authentication on endpoints
    • [x] Integrate authentication into UI
    • [x] Cache token as a cookie
    • [x] Add mechanism to create a user
    • [x] Add /api prefix to all API endpoints
    • [x] Validate token on every page
    • [x] Implement authentication for SocketIO
    • [x] Make Login and Registration pages look acceptable
    • [x] Update README

    Closes #4

    opened by scottbarnesg 0
  • Fix docker-compose build hanging with large video directory

    Fix docker-compose build hanging with large video directory

    Changes:

    • Adds .dockerignore w/ entry to ignore video data dir

    Testing:

    • Create data/videos and put lots of data into it.
    • Check out this branch and run docker-compose build server
    • Verify the command does not hang

    Fixes #20

    opened by scottbarnesg 0
  • Update image transmission to use a video stream

    Update image transmission to use a video stream

    References:

    • https://pericror.com/software/python-create-a-webrtc-video-stream-from-images/
    • https://github.com/aiortc/aiortc
    • https://pypi.org/project/av/
    enhancement 
    opened by scottbarnesg 0
  • Redesign the UI

    Redesign the UI

    The existing UI provides minimal functionality and needs an overhaul

    Key changes:

    • Update video stream page to allow clicking on stream to increase its size on the page. Possible reduce non-selected videos to side-bar.
    • Update the video replay page to make videos searchable by date, time, camera id, etc.
    enhancement help wanted 
    opened by scottbarnesg 0
Releases(0.3.6)
  • 0.3.6(Nov 19, 2022)

  • 0.3.5(Sep 11, 2022)

  • 0.3.4(Aug 11, 2022)

  • 0.3.3(Aug 3, 2022)

    • Updates UI to automatically refresh session token before it expires.
    • Automatically redirects the UI to the login page if token validation fails.
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Jul 31, 2022)

    • Improves motion detection algorithm, replacing background subtraction with contour-based algorithm.
    • Recorded videos now have a box drawn around the area of motion detected.
    • Moves motion detection threshold value from input argument to environment variable
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Jul 24, 2022)

  • 0.3.0(Jul 23, 2022)

  • 0.2.9(Jun 20, 2022)

  • 0.2.8(Jun 20, 2022)

  • 0.2.7(May 3, 2022)

  • 0.2.6(Apr 24, 2022)

  • 0.2.5.a(Apr 22, 2022)

  • 0.2.4(Apr 21, 2022)

  • 0.2.3(Mar 28, 2022)

    • Makes the motion detection threshold configurable via the cli
    • Fixes an issue that caused docker-compose to hang with a large video data directory
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(Mar 27, 2022)

    • Fixes an issue that caused CORS errors in some browsers when using self-signed certificates.
    • Updates the server configuration to serve both the Web UI and API from the Flask server.
    • Updates the default server listening port to 8443 for both the web app and API.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Mar 21, 2022)

    • Bug fixes for the motion detection algorithm.
    • Updates the list of saved videos to display in order w/ most recent first.
    • Adds support for dynamically setting the API url in the UI at runtime
    • Updates frontend docker container to Node v16
    Source code(tar.gz)
    Source code(zip)
Owner
Scott Barnes
Software Engineer
Scott Barnes
Static Features Classifier - A static features classifier for Point-Could clusters using an Attention-RNN model

Static Features Classifier This is a static features classifier for Point-Could

ABDALKARIM MOHTASIB 1 Jan 25, 2022
DLWP: Deep Learning Weather Prediction

DLWP: Deep Learning Weather Prediction DLWP is a Python project containing data-

Kushal Shingote 3 Aug 14, 2022
Tools for computational pathology

A toolkit for computational pathology and machine learning. View documentation Please cite our paper Installation There are several ways to install Pa

254 Dec 12, 2022
Datasets, Transforms and Models specific to Computer Vision

torchvision The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision. Installat

13.1k Jan 02, 2023
This project provides the code and datasets for 'CapSal: Leveraging Captioning to Boost Semantics for Salient Object Detection', CVPR 2019.

Code-and-Dataset-for-CapSal This project provides the code and datasets for 'CapSal: Leveraging Captioning to Boost Semantics for Salient Object Detec

lu zhang 48 Aug 19, 2022
PyTorch implementation of the TTC algorithm

Trust-the-Critics This repository is a PyTorch implementation of the TTC algorithm and the WGAN misalignment experiments presented in Trust the Critic

0 Nov 29, 2021
Official repository for "PAIR: Planning and Iterative Refinement in Pre-trained Transformers for Long Text Generation"

pair-emnlp2020 Official repository for the paper: Xinyu Hua and Lu Wang: PAIR: Planning and Iterative Refinement in Pre-trained Transformers for Long

Xinyu Hua 31 Oct 13, 2022
Repository for XLM-T, a framework for evaluating multilingual language models on Twitter data

This is the XLM-T repository, which includes data, code and pre-trained multilingual language models for Twitter. XLM-T - A Multilingual Language Mode

Cardiff NLP 112 Dec 27, 2022
[TIP2020] Adaptive Graph Representation Learning for Video Person Re-identification

Introduction This is the PyTorch implementation for Adaptive Graph Representation Learning for Video Person Re-identification. Get started git clone h

WuYiming 41 Dec 12, 2022
All course materials for the Zero to Mastery Machine Learning and Data Science course.

Zero to Mastery Machine Learning Welcome! This repository contains all of the code, notebooks, images and other materials related to the Zero to Maste

Daniel Bourke 1.6k Jan 08, 2023
[CVPR 2019 Oral] Multi-Channel Attention Selection GAN with Cascaded Semantic Guidance for Cross-View Image Translation

SelectionGAN for Guided Image-to-Image Translation CVPR Paper | Extended Paper | Guided-I2I-Translation-Papers Citation If you use this code for your

Hao Tang 424 Dec 02, 2022
Sum-Product Probabilistic Language

Sum-Product Probabilistic Language SPPL is a probabilistic programming language that delivers exact solutions to a broad range of probabilistic infere

MIT Probabilistic Computing Project 57 Nov 17, 2022
HSC4D: Human-centered 4D Scene Capture in Large-scale Indoor-outdoor Space Using Wearable IMUs and LiDAR. CVPR 2022

HSC4D: Human-centered 4D Scene Capture in Large-scale Indoor-outdoor Space Using Wearable IMUs and LiDAR. CVPR 2022 [Project page | Video] Getting sta

51 Nov 29, 2022
NAVER BoostCamp Final Project

CV 14조 final project Super Resolution and Deblur module Inference code & Pretrained weight Repo SwinIR Deblur 실행 방법 streamlit run WebServer/Server_SRD

JiSeong Kim 5 Sep 06, 2022
Gems & Holiday Package Prediction

Predictive_Modelling Gems & Holiday Package Prediction This project is based on 2 cases studies : Gems Price Prediction and Holiday Package prediction

Avnika Mehta 1 Jan 27, 2022
Building blocks for uncertainty-aware cycle consistency presented at NeurIPS'21.

UncertaintyAwareCycleConsistency This repository provides the building blocks and the API for the work presented in the NeurIPS'21 paper Robustness vi

EML Tübingen 19 Dec 12, 2022
Sky Computing: Accelerating Geo-distributed Computing in Federated Learning

Sky Computing Introduction Sky Computing is a load-balanced framework for federated learning model parallelism. It adaptively allocate model layers to

HPC-AI Tech 72 Dec 27, 2022
Housing Price Prediction

This project aim was to predict the price of houses in the Boston area during the great financial crisis through regression, as well as classify houses into different quality categories according to

Florian Klement 1 Jan 27, 2022
This repository contains the implementation of the paper: "Towards Frequency-Based Explanation for Robust CNN"

RobustFreqCNN About This repository contains the implementation of the paper "Towards Frequency-Based Explanation for Robust CNN" arxiv. It primarly d

Sarosij Bose 2 Jan 23, 2022
Exploration of some patients clinical variables.

Answer_ALS_clinical_data Exploration of some patients clinical variables. All the clinical / metadata data is available here: https://data.answerals.o

1 Jan 20, 2022