https://github.com/moimart/hass-tpu-person-detector
Integrate your rtsp cameras with simple person detection into a Home Assistant device with MQTT
https://github.com/moimart/hass-tpu-person-detector
edge-tpu home-assistant jetson-nano mqtt
Last synced: 7 months ago
JSON representation
Integrate your rtsp cameras with simple person detection into a Home Assistant device with MQTT
- Host: GitHub
- URL: https://github.com/moimart/hass-tpu-person-detector
- Owner: moimart
- License: mit
- Created: 2022-01-11T19:54:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-22T19:35:51.000Z (over 3 years ago)
- Last Synced: 2025-01-19T19:56:44.649Z (9 months ago)
- Topics: edge-tpu, home-assistant, jetson-nano, mqtt
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
hass-tpu-person-detection
===============### Python program for person detection for Nvidia's Jetson boards (soon Google's Coral EDGE TPU) integration with HomeAssistant through MQTT
## Features:
* Detects persons in several video streams as a single sensor. Perfect for exterior setups as it is simplified in one detection device
* Creates a device in Home Assistant through MQTT that publishes:
- Cameras sources are active
- Last snapshot of detected class (person) per camera
- Binary Occupancy sensor
- Number of persons sensor
- Last time of detection
* Takes snapshots when detection occurs as PNGs with detections
* Takes video files after detection occurs## TODO:
* Coral EDGE TPU implementation
* Selection of classes to track (not just person)
* Auto-upload of snapshots and videos
* Docker image
* Multiple instances (in order to have multiple Home Assistant's devices)
* Expose labelling data for network training of detections## Usage:
1. Install dependencies specified in setup.py -- setup.py does not work:
'ffmpeg-python', 'numpy','pillow', 'paho-mqtt'
If you are using Jetson, you need jetson-inference to be available. Google's Coral EDGE TPU development has not started yet.
```
$ pip3 install ffmpeg-python numpy pillow paho-mqtt
```
3. Rename rename_to_config.py to config.py
4. Edit the config.py to adjust it to your setup
5. Make sure to have a MQTT broker installed with Home Assistant (i.e. Mosquito MQTT Broker)
6. Run the script
```
$ python3 multicamera_detection.py # for multiple cameras (setting sources in config) without rtsp re-stream
```