A monitor to manage your Motion captures directory and request human detection from arm-tiny-yolow (must be running somewhere).
To start, you need to mount the pictures directory from Motion on /data and configure global variables in /conf/monitor.py :
docker run -d --name arm-monitor -v <conf_directory>:/conf/ -v <data_directory>:/data arm-monitor
Based on Raspbian Linux Stretch, Python 3.5, and OpenCV 3.4.4
- Monitor listens for new files in the Motion pictures/ directory
- When new files are added, it stores each new file name and waits until the detection is over + 15 seconds
- The last frame captured is an empty one as there is a 5 to 10 seconds with no motion detected configured in Motion
- This frame is used as the reference one to extract deltas with the others
- Each other frame is analyzed against the reference one and the extracted deltas greather than 100x200 (aka contours) are sent to the Tiny Yolo RNN which performs human detection
- Tiny Yolo returns the presence of a person with the associated probability
- For each frame processed, Monitor only keeps the name and probability with the highest probability
- At the end of frame processing, if this probability is above 40%, then Monitor notifies Slack that a human has come in the lanscape