Skip to content

This repository contains the codes to run tensorflow image recognition with Inception V3 network in ROS. Also, enable users to train their own network model for image recognition.

License

Notifications You must be signed in to change notification settings

kungfrank/ros_inception_v3

Repository files navigation

ros_inception_v3

This repository contains the codes to run tensorflow image recognition with Inception V3 network in ROS. Also, enable users to train their own network model for image recognition.

reference

retrain tensorflow official image recognition(inception v3) model: https://github.com/akshaypai/tfClassifier

runing tensorflow official image recognition(inception v3) in ros: https://github.com/OTL/rostensorflow

Developer

*PouChun, Kung (k3083518729@gmail.com)

Usage & Tutorial

Medium Notes: https://medium.com/@k3083518729/tensorflow-image-recognition-58b0ac77c263

ROS camera driver & dependencies install

$ sudo apt-get install ros-kinetic-cv-bridge ros-kinetic-opencv3

Install camera driver (for example:cv_camera)

$ sudo apt-get install ros-kinetic-cv-camera

TensorFlow install

Please read official guide. https://www.tensorflow.org/install/install_linux

image_recognition.py

  • publish: /result (std_msgs/String)
  • subscribe: /image (sensor_msgs/Image)

Usage

$ roscore
$ rosrun cv_camera cv_camera_node
$ python image_recognition.py image:=/cv_camera/image_raw
$ rostopic echo /result

Retrain your own model

Download retrain code

$ git clone https://github.com/akshaypai/tfClassifier
$ cd tfClassifier/image_classification

Download dataset(for example:flower_photos dataset)

cd ~
curl -O http://download.tensorflow.org/example_images/flower_photos.tgz
tar xzf flower_photos.tgz

Retrain

python retrain.py --model_dir ./inception --image_dir ~/flower_photos ./output --how_many_training_steps 1000

After retrain process finish you can find ./output.pb and ./labels.txt in /tmp folder .

Move or copy them to ros_inception_v3 folder.

Replace original ./output.pb and ./labels.txt file with new file.

Start test

$ roscore
$ rosrun cv_camera cv_camera_node
$ python image_recognition.py image:=/cv_camera/image_raw
$ rostopic echo /result

About

This repository contains the codes to run tensorflow image recognition with Inception V3 network in ROS. Also, enable users to train their own network model for image recognition.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages