All Projects → alsora → ros2-tensorflow

alsora / ros2-tensorflow

Licence: Apache-2.0 license
ROS2 nodes for computer vision tasks in Tensorflow

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects
shell
77523 projects
CMake
9771 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ros2-tensorflow

stackml-js
Machine Learning platform in-browser for creators
Stars: ✭ 34 (-17.07%)
Mutual labels:  image-classification
tutorials
A tutorial series by Preferred.AI
Stars: ✭ 136 (+231.71%)
Mutual labels:  image-classification
KRS
The Kria Robotics Stack (KRS) is a ROS 2 superset for industry, an integrated set of robot libraries and utilities to accelerate the development, maintenance and commercialization of industrial-grade robotic solutions while using adaptive computing.
Stars: ✭ 26 (-36.59%)
Mutual labels:  ros2
ResNet-50-CBAM-PyTorch
Implementation of Resnet-50 with and without CBAM in PyTorch v1.8. Implementation tested on Intel Image Classification dataset from https://www.kaggle.com/puneet6060/intel-image-classification.
Stars: ✭ 31 (-24.39%)
Mutual labels:  image-classification
zalo-landmark
Zalo AI Challenge - Landmark Identification
Stars: ✭ 39 (-4.88%)
Mutual labels:  image-classification
community
ROS 2 Hardware Acceleration Working Group community governance model & list of projects
Stars: ✭ 34 (-17.07%)
Mutual labels:  ros2
zenoh-c
zenoh client library written in C and targeting micro-controllers.
Stars: ✭ 28 (-31.71%)
Mutual labels:  ros2
deep-learning
Projects include the application of transfer learning to build a convolutional neural network (CNN) that identifies the artist of a painting, the building of predictive models for Bitcoin price data using Long Short-Term Memory recurrent neural networks (LSTMs) and a tutorial explaining how to build two types of neural network using as input the…
Stars: ✭ 43 (+4.88%)
Mutual labels:  image-classification
deepstack-ui
UI for working with Deepstack
Stars: ✭ 115 (+180.49%)
Mutual labels:  image-classification
goexif2
MAINTAINER WANTED -- Decode embedded EXIF meta data from image files written in Pure Golang
Stars: ✭ 35 (-14.63%)
Mutual labels:  image-classification
vox nav
A project to develop/adapt a navigation system for outdoor robotics in rough uneven terrains
Stars: ✭ 101 (+146.34%)
Mutual labels:  ros2
tensorflow-video-classifier
image classification via video input, frame-by-frame
Stars: ✭ 16 (-60.98%)
Mutual labels:  image-classification
trojanzoo
TrojanZoo provides a universal pytorch platform to conduct security researches (especially backdoor attacks/defenses) of image classification in deep learning.
Stars: ✭ 178 (+334.15%)
Mutual labels:  image-classification
rostaller
Make it easy for you to install ROS 1 (indigo, kinetic, melodic and noetic) and ROS 2 (galactic) on corresponding ubuntu distributions automatically in just 4 steps.
Stars: ✭ 102 (+148.78%)
Mutual labels:  ros2
zed-ros2-wrapper
ROS 2 wrapper beta for the ZED SDK
Stars: ✭ 61 (+48.78%)
Mutual labels:  ros2
backprop
Backprop makes it simple to use, finetune, and deploy state-of-the-art ML models.
Stars: ✭ 229 (+458.54%)
Mutual labels:  image-classification
Evo-ViT
Official implement of Evo-ViT: Slow-Fast Token Evolution for Dynamic Vision Transformer
Stars: ✭ 50 (+21.95%)
Mutual labels:  image-classification
MNIST
Handwritten digit recognizer using a feed-forward neural network and the MNIST dataset of 70,000 human-labeled handwritten digits.
Stars: ✭ 28 (-31.71%)
Mutual labels:  image-classification
isaac ros apriltag
CUDA-accelerated Apriltag detection
Stars: ✭ 42 (+2.44%)
Mutual labels:  ros2
meta-st-stm32mpu-ai
This repository contains the OpenEmbedded meta layer to install AI frameworks and tools for the STM32MP1
Stars: ✭ 32 (-21.95%)
Mutual labels:  image-classification

ros2-tensorflow

Use Tensorflow to load pretrained neural networks and perform inference through ROS2 interfaces.

Rviz2 detection output

The output can be directly visualized through Rviz

Requirements

In order to build the ros2-tensorflow package, the following dependencies are needed

Required dependencies:

Rosdep dependencies:

Optional dependencies:

The provided Dockerfile contains an Ubuntu 18.04 environment with all the dependencies and this package already installed.

To use the Dockerfile:

$ git clone https://github.com/alsora/ros2-tensorflow.git
$ cd ros2-tensorflow/docker
$ bash build.sh
$ bash run.sh

Build

This section describes how to build the ros2-tensorflow package and the required depenencies in case you are not using the provided Dockerfile.

Get the source code and create the ROS 2 workspace

$ git clone https://github.com/alsora/ros2-tensorflow.git $HOME/ros2-tensorflow
$ mkdir -p $HOME/tf_ws/src
$ cd $HOME/tf_ws
$ ln -s $HOME/ros2-tensorflow/ros2-tensorflow src

Install required dependencies using rosdep

$ rosdep install --from-paths src --ignore-src --rosdistro foxy -y

Install the Tensorflow Object Detection Models (optional). Make sure to specify the correct Python version according to your system.

$ sudo apt-get install -y protobuf-compiler python-lxml python-tk
$ pip install --user Cython contextlib2 jupyter matplotlib Pillow
$ git clone https://github.com/tensorflow/models.git /usr/local/lib/python3.8/dist-packages/tensorflow/models
$ cd usr/local/lib/python3.8/dist-packages/tensorflow/models/research
$ protoc object_detection/protos/*.proto --python_out=.
$
$ echo 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/dist-packages/tensorflow/models/research' >> $HOME/.bashrc

Install Tensorflow Slim (optional)

$ pip install tf_slim

Build and install the ros2-tensorflow package

$ colcon build
$ source install/local_setup.sh

Usage

The basic usage consists in creating a ROS 2 node which loads a Tensorflow model and another ROS 2 node that acts as a client and receives the result of the inference.

It is possible to specify which model a node should load. Note that if the model is specified via url, as it is by default, the first time the node is executed a network connection will be required in order to download the model.

Object Detection Task

Test the object detection server by running in separate terminals

$ ros2 run tf_detection_py server
$ ros2 run tf_detection_py client_test

Setup a real object detection pipeline using a stream of images coming from a ROS 2 camera node

$ rviz2
$ ros2 run tf_detection_py server
$ ros2 run image_tools cam2image --ros-args -p frequency:=2.0

Image Classification Task

Test the image classification server by running in separate terminals

$ ros2 run tf_classification_py server
$ ros2 run tf_classification_py client_test

Loading different models

The repository contains convenient APIs for loading Tensorflow models into the ROS 2 nodes.

Models are defined using the ModelDescriptor class, which contains all the information required for loading a model and performing inference on it. It can either contain a path where the model can be found on the machine or an URL where the model can be downloaded the first time.

Different model formats are also supported, such as frozen models and saved models.

Some known supported models are already present as examples. See classification models and detection models

The Tensorflow models repository contains many pretrained models that can be used. For example, you can get additional Tensorflow model for object detection from the detection model zoo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].