https://github.com/sensoranalyticsaus/km-mod
Image Classifier for Security Cameras
https://github.com/sensoranalyticsaus/km-mod
image-classification kmeans-clustering raspberry-pi
Last synced: 28 days ago
JSON representation
Image Classifier for Security Cameras
- Host: GitHub
- URL: https://github.com/sensoranalyticsaus/km-mod
- Owner: SensorAnalyticsAus
- License: apache-2.0
- Created: 2024-05-20T13:07:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-22T02:50:41.000Z (over 1 year ago)
- Last Synced: 2025-10-11T13:12:59.687Z (8 months ago)
- Topics: image-classification, kmeans-clustering, raspberry-pi
- Language: Python
- Homepage: https://www.sensoranalytics.com.au
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### About ###
*KM-MOD* provides a standalone image classifier for use with date-time stamped (YYYYMMDD-HHMMSS) images which most security cameras produce. Repetitive images are filtered out leaving only images of interest. Selected images are converted into a time-lapse video.
### Requirements
* RPI4 2GB or higher
* Python 3.4 or higher
### Setup
```
python -m pip install -U pip
python -m pip install -U scikit-image
pip install opencv-python
pip install shutils
pip install -U scikit-learn (for kmeans)
pip install matplotlib
sudo apt update
sudo apt upgrade
sudo apt install ffmpeg
```
### Getting Started
`git clone https://github.com/SensorAnalyticsAus/KM-MOD.git`
`cd KM-MOD`
### Config
Paths and the `DV` identifier string need to be set to actual paths/value at the beginning of these files. The `DV` value must be the same among `daily-driver-mp`, `moviefrm-list`, and `moviefrm-list-ni`
```
config.py
daily-driver-mp
moviefrm-list
moviefrm-list-ni (non-interactive version used by `daily-driver-mp`)
```
### Example 1
Step 1 train
`/path/to/.venv/bin/python train-km-mp.py on 1 10 20240506000000 20240506235959`
Step 2 predict (output frames from selected clusters from step 1)
`/path/to/.venv/bin/python predict-km.py 80`
Step 3 create a time-lapse video
`./moviefrm-list 20`
### Example 2
`./daily-driver-mp on`
or
`./daily-driver-mp off`
`off` prevents the progress-bar from showing, useful for `cron`
This is best run at say 7am and 7pm daily as a `cron` job