Skip to content

gbr1/edgeimpulse_ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 6, 2023
79aaf97 · Aug 6, 2023

History

15 Commits
Aug 6, 2023
Aug 9, 2022
Aug 9, 2022
Aug 4, 2022
Aug 6, 2023
Aug 6, 2023
Sep 27, 2022
Aug 6, 2023

Repository files navigation

edgeimpulse_ros

ROS2 Humble wrapper for Edge Impulse on Linux.

ezgif-4-3cda6ac695

1. Topics

  • /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

2. Parameters

  • frame_id (string), "base_link", frame id of output topics
  • model.filepath (string), "", absolute filepath to .eim file
  • show.overlay (bool), true, show bounding boxes on output image
  • show.center (bool), false, show centroids on output image
  • show.labels (bool), true, show labels on bounding boxes,
  • show.classification_info (bool), true, show the attendibility (0-1) of the prediction

3. How to install

  1. install edge_impulse_linux:
    pip3 install edge_impulse_linux

  2. 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

  3. download your .eim file as "linux board" and choose your architecture

  4. make your eim file as executable:
    cd /path/to/your/eim/file
    chmod +x <file>.eim

  5. clone this repo in your workspace:
    cd ~/dev_ws/src git clone https://github.com/gbr1/edgeimpulse_ros

  6. check dependencies:
    cd ~/dev_ws
    rosdep install --from-paths src --ignore-src -r -y

  7. build:
    colcon build --symlink-install
    source install/setup.bash

4. How to run

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" `

5. Models

Here you find some prebuilt models: https://github.com/gbr1/edgeimpulse_example_models

6. Known issues

  • 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