- Connect to RSTP camera to record video
- Detects people, cats, dogs within video (using YOLO model), then sends email notification with captured frame and video
- Web server for accessing recordings
- recording service: captures video and runs object detection algorithm
- HTTP server: sends email notifications and renders web algorithm
- MySQL database: persists detections and image/video file locations with timestamps
Uses docker-compose to run all services
To set-up the recording service, create JSON files like the following:
{
"link": "RTSP camera link w/ IP address",
"camera_id": "Camera ID",
"camera_name": "Camera name for camera",
"min_detection_height": "minimum height of detected object for filtering (float between 0 and 1)",
"min_hw_ratio": "minimum height to width ratio of detected object for filtering (float)"
}
CONFIG_FILE
: path to JSON config file relative to the capture scriptWEIGHTS_FILE
: path to YOLO weights file relative to the capture scriptEMAIL_SOURCE
: email address to send email fromEMAIL_DEST
: Python list of email addresses to send notification email toEMAIL_PASS
: base64 encoded password toEMAIL_SOURCE
email addressMYSQL_USER
: username to access MySQL database (set toroot
)MYSQL_ROOT_PASSWORD
: root password to MySQL database
Recommendation is to use .env
file to store environment variables.
- Create a virtual environment and activate
- Run
pip install -r requirements.txt
underrecorder/
- Set
APP_ENV
environment variable todevelopment
. This disables writes into the MySQL database. - Run
python -u capture.py
in therecorder/src
directory.
- Run
go get
underserver/
- Start the web server by running
go run app.go
Deploying service just starts the production-esque services on the local machine.
- Run
make run
- To stop production services, run
docker-compose down
in the root directory of the repo - For first time setup, run
make mysql
and enter the credentials. Copy the commands ininit.sql
to setup the database and create the tables.