Code Monkey home page Code Monkey logo

object_detection_tensorflow's Introduction

Tensorflow Object Detection API in a ROS node!!!

Detect objects as bounding boxes or masks using one of 28 models from Tensorflow Models repository!

Examples

Install

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

Download models

You can download manually from the models zoo: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

Or you can use the download script provided in this repo!!!

It will download all models for you:

python scripts/download_all_models.py

or you can use ROS to run it:

rosrun object_detection_tensorflow download_all_models.py

This script will download 28 models for you (Updated on 2018.09.16):

  1. faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28
  2. faster_rcnn_inception_resnet_v2_atrous_lowproposals_coco_2018_01_28
  3. faster_rcnn_inception_resnet_v2_atrous_lowproposals_oid_2018_01_28
  4. faster_rcnn_inception_resnet_v2_atrous_oid_2018_01_28
  5. faster_rcnn_inception_v2_coco_2018_01_28
  6. faster_rcnn_nas_coco_2018_01_28
  7. faster_rcnn_nas_lowproposals_coco_2018_01_28
  8. faster_rcnn_resnet101_ava_v2.1_2018_04_30
  9. faster_rcnn_resnet101_coco_2018_01_28
  10. faster_rcnn_resnet101_kitti_2018_01_28
  11. faster_rcnn_resnet101_lowproposals_coco_2018_01_28
  12. faster_rcnn_resnet50_coco_2018_01_28
  13. faster_rcnn_resnet50_lowproposals_coco_2018_01_28
  14. mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28
  15. mask_rcnn_inception_v2_coco_2018_01_28
  16. mask_rcnn_resnet101_atrous_coco_2018_01_28
  17. mask_rcnn_resnet50_atrous_coco_2018_01_28
  18. rfcn_resnet101_coco_2018_01_28
  19. ssd_inception_v2_coco_2018_01_28
  20. ssdlite_mobilenet_v2_coco_2018_05_09
  21. ssd_mobilenet_v1_0.75_depth_300x300_coco14_sync_2018_07_03
  22. ssd_mobilenet_v1_0.75_depth_quantized_300x300_coco14_sync_2018_07_18
  23. ssd_mobilenet_v1_coco_2018_01_28
  24. ssd_mobilenet_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03
  25. ssd_mobilenet_v1_ppn_shared_box_predictor_300x300_coco14_sync_2018_07_03
  26. ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18
  27. ssd_mobilenet_v2_coco_2018_03_29
  28. ssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03

Run Webcam example

I provide example ROS launch files for:

SSD Mobilenet V2

roslaunch object_detection_tensorflow ssd_mobilenet_v2.launch

SSD_Mobilenet_V2

Mask RCNN Inception V2

roslaunch object_detection_tensorflow mask_rcnn_inception_v2.launch

Mask RCNN Inception V2

Nodes

object_detection_tensorflow.py

Published Topics

  • sensor_msgs/CompressedImage
  • object_detection_tensorflow_msgs/BBoxArray

Parameters

  • ~camera_topic default: /image_raw - Input topic
  • ~models_dir - directory where models are downloaded
  • ~model_name - name of the directory where the model is located
  • ~path_to_labels - path to labels.pbtxt
  • ~num_classes default: 90 - number o classes

object_detection_tensorflow_viz.py

Viz

Node is an example of BBoxArray subscriber. It subscribes to BBoxArray and image, draws bboxes and publishes the result.

Subscribed Topics

  • sensor_msgs/CompressedImage
  • object_detection_tensorflow_msgs/BBoxArray

Published Topics

  • sensor_msgs/CompressedImage

object_detection_tensorflow's People

Contributors

karolmajek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

object_detection_tensorflow's Issues

download_all_models.py not working

Hi, the download_all_models.py script is not working for Python3 because urllib2 is not supported. Even when I change it to the proper library the
matches = re.findall('(http[A-Za-z0-9\:\/_\-\.]*tar\.gz)', html, re.DOTALL)
line is not working.

Error after calling the ssd file inside models.

tensorflow.python.framework.errors_impl.NotFoundError: /home/srichitra/project_ws/src/object_detection_tensorflow/object_detection_tensorflow/models/ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.pb; No such file or directory
This is the error I am getting. I downloaded the models from https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2_detection_zoo.md
The link mentioned your code to download models showed an error, so I changed the url as above.
What are the changes I should make inside the model file to get the code running? What is frozen_inference_graph.pb ?

Thanks in advance!:-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.