https://github.com/carsonfenimore/atomrust
https://github.com/carsonfenimore/atomrust
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/carsonfenimore/atomrust
- Owner: carsonfenimore
- License: mit
- Created: 2024-10-22T01:40:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-04T15:47:46.000Z (8 months ago)
- Last Synced: 2025-11-04T17:20:24.255Z (8 months ago)
- Language: Rust
- Size: 4.04 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# atomrust
Atomrust provides the foundational layer for AI-enabled raspberry pi cameras. It efficiently (without decoding) streams RGB frames to tflite while streaming H.264 via RTSP. Sensor stats can also be pushed via MQTT. It does this efficiently, requiring only 10% CPU on pi zero 2w (excluding tflite processing)
When coupled with a high-quality camera module, such as a Sony Starvis based sensor, and an nvr such as BlueIris, this can provide an extremely robust, in-house security system.
## Requirements
- 64-bit versions pi OS
- ~128MB of ram
- around 0.5 cores on a pi zero 2w.
TFLite processing can consume a user-selectable number of cores. For a pi zero 2w, if atomrust is configured to use 2 threads processing is capped at around 4fps.
- rpicam-apps build: v1.10.0 24906da670e9-dirty 04-11-2025 (10:35:52)
- libcamera build: v0.5.2+99-bfd68f78
## Building
Before building remember to build/install libcamera/rpicam-apps. Once this is done you can build atomrust as follows:
```
sudo apt install libssl-dev
cargo build
```
> [!WARNING]
> tflite seems to have a small build error, as reported here: https://github.com/conan-io/conan-center-index/issues/24538. You can fix this by:
```
vim `find . -iname "spectrogram.cc"`
#include // <-- add this line right above the line saying #include
```
## Running
Note: for objdet we have included mobilenetv2/coco labels inside the models subdir
Populate a config.yaml, such as the following
server:
host: 0.0.0.0
port: 5554
camera:
rtsppath: "/video"
width: 1920
height: 1080
lowres_width: 300
lowres_height: 300
framerate: 30
bitrate: "4mbps"
profile: "main"
intraperiod: 5
mqtt:
username: "mqttuser"
password: "mqttpass"
host: ""
port:
obj_name: "atomcam"
pipeline:
model_filename: "models/ssd_mobilenet_v2_coco_quant_postprocess.tflite"
threshold: 0.6
label_filename: "models/coco_labels.txt"
num_threads: 2
Then run
LOG=info LD_LIBRARY_PATH=../libcamlite/build/ ./target/debug/atomrust config.yaml
## Development Status
This project is under active development and isn't fully ready. We hope to have an easily-deployable release soon.
## Changelog
- 0.1.2
- support for latest libcamlite-rs
- make mqtt and pipeline stages optional - ommitting both results in a simple rtsp server doing no processing or reporting
- 0.1.1
- added tflite (after accidentally deleting it before pushing the code)
- tie together mqtt and tflite objdet - home assistant, ala mqtt discovery, should now know when an objdet occurs.
alarm clears 5 sec after nothing seen.
- 0.1.0
- initial release performing parallel h264 rtsp streaming and no-op rgb (future feed for objdet)