ROS2 Humble wrapper for Edge Impulse on Linux.
/detection/input/image
, image topic to analyze/detection/output/image
, image with bounding boxes/detection/output/info
, VisionInfo message/detection/output/results
, results as text
frame_id
(string), "base_link", frame id of output topicsmodel.filepath
(string), "", absolute filepath to .eim fileshow.overlay
(bool), true, show bounding boxes on output imageshow.center
(bool), false, show centroids on output imageshow.labels
(bool), true, show labels on bounding boxes,show.classification_info
(bool), true, show the attendibility (0-1) of the prediction
-
install edge_impulse_linux:
pip3 install edge_impulse_linux
-
on some boards and aarch64 these are required (e.g. vm on mac m1):
sudo apt-get install libatlas-base-dev libportaudio2 libportaudiocpp0 portaudio19-dev
pip3 install pyaudio
-
download your .eim file as "linux board" and choose your architecture
-
make your eim file as executable:
cd /path/to/your/eim/file
chmod +x <file>.eim
-
clone this repo in your workspace:
cd ~/dev_ws/src
git clone https://github.com/gbr1/edgeimpulse_ros
-
check dependencies:
cd ~/dev_ws
rosdep install --from-paths src --ignore-src -r -y
-
build:
colcon build --symlink-install
source install/setup.bash
Launch the node:
ros2 run edgeimpulse_ros image_classification --ros-args -p model.filepath:="</absolute/path/to/your/eim/file.eim>" -r /detection/input/image:="/your_image_topic"
`
Here you find some prebuilt models: https://github.com/gbr1/edgeimpulse_example_models
- if you use a classification model, topic results is empty
- you cannot change color of bounding boxes (coming soon)
- other types (imu and sound based ml) are unavailable
Copyright © 2022 Giovanni di Dio Bruno - gbr1.github.io