Sign inSign up

shaderobotics/ghostnet

By shaderobotics

•Updated about 4 years ago

This is a ROS2 wrapper for the image classification algorithm, GhostNet

Image
0

342

shaderobotics/ghostnet repository overview

⁠GhostNet-ROS2 Wrapper

This is a ROS2 wrapper for the image classification algorithm, GhostNet⁠. We utilize pytorch and torch.hub for the source of the algorithm⁠. The main idea is for this container to act as a standalone interface and node, removing the necessity to integrate separate packages and solve numerous dependency issues.

Efficient networks by generating more features from cheap operations. Based on a set of intrinsic feature maps, GhostNet applies a series of linear transformations with cheap cost to generate many ghost feature maps that could fully reveal information underlying intrinsic features. The proposed Ghost module can be taken as a plug-and-play component to upgrade existing convolutional neural networks. Ghost bottlenecks are designed to stack Ghost modules, and then the lightweight GhostNet can be easily established.

This makes GhostNet readily useable on embedded systems such as the Jetson devices.

⁠Installation Guide

⁠Using Docker Pull

  1. Install Docker⁠ and ensure the Docker daemon is running in the background.
  2. Run docker pull shaderobotics/ghostnet:${ROS2_DISTRO} we support all ROS2 distributions
  3. Follow the run commands in the usage section below

⁠Build Docker Image Natively

  1. Install Docker⁠ and ensure the Docker daemon is running in the background.
  2. Clone this repo with git pull -b ${ROS2_DISTRO} https://github.com/open-shade/ghostnet.git
  3. Enter the repo with cd ghostnet
  4. Build the container with docker build . -t [name]. This will take a while. We have also provided associated cloudbuild.sh scripts to build on GCP.
  5. Follow the run commands in the usage section below.

⁠Usage

⁠Run the GhostNet Node

Run docker run --net=host shaderobotics/ghostnet:${ROS2_DISTRO}. Your node should be running now. Then, by running ros2 topic list, you should see all the possible pub and sub routes.

For more details explaining how to run Docker images, visit the official Docker documentation here⁠. Also, additional information as to how ROS2 communicates between external environment or multiple docker containers, visit the official ROS2 (foxy) docs here⁠.

⁠Topics

NameIOTypeUse
ghostnet/image_rawsubsensor_msgs.msg.Image⁠Takes the raw camera output to be processed
ghostnet/resultpubStringOutputs the classification label from ImageNet 100 Classes as a string

⁠Testing / Demo

To test and ensure that this package is properly installed, replace the Dockerfile in the root of this repo with what exists in the demo folder. Installed in the demo image contains a camera stream emulator⁠ by klintan⁠ which directly pubs images to the GhostNet node and processes it for you to observe the outputs.

To run this, run docker build . -t [name], then docker run --net=host -t [name]. Observing the logs for this will show you what is occuring within the container. If you wish to enter the running container and preform other activities, run docker ps, find the id of the running container, then run docker exec -it [containerId] /bin/bash

Tag summary

Content type

Image

Digest

sha256:c387f5db4…

Size

4.5 GB

Last updated

about 4 years ago

docker pull shaderobotics/ghostnet:galactic