Giter Club home page Giter Club logo

image_recognition's Introduction

TU/e Robotics image_recognition

CI Industrial CI

Packages for image recognition - Robocup TU/e Robotics

Package status & Description

Package Build status Xenial Kinetic x64 Description
image_recognition Build Status Meta package for all image_recognition packages.
image_recognition_analysis Build Status analysis for image recognition
image_recognition_color_extractor Build Status Extract dominant colors from images
image_recognition_jetson Build Status ROS wrapper for Jetson Inference (https://github.com/dusty-nv/jetson-inference) for running inference using TensorRT.
image_recognition_keras Build Status ROS wrappers for Keras neural nets.
image_recognition_msgs Build Status Interface definition for image recognition
image_recognition_openface Build Status ROS wrapper for Openface (https://github.com/cmusatyalab/openface) to detect and recognize faces in images.
image_recognition_openpose Build Status ROS wrapper for Openpose (https://github.com/CMU-Perceptual-Computing-Lab/) for getting poses of 2D images.
image_recognition_pytorch Build Status ROS wrapper around a PyTorch model for (https://github.com/Nebula4869/PyTorch-gender-age-estimation) for getting age & gender estimations on faces
image_recognition_rqt Build Status RQT tools with helpers testing this interface and training/labeling data.
image_recognition_skybiometry Build Status ROS wrapper for Skybiometry (https://skybiometry.com/) for getting face properties of a detected face, e.g. age estimation, gender estimation etc.
image_recognition_tensorflow Build Status Object recognition with use of Tensorflow. The user can retrain the top layers of a neural network to perform classification with its own dataset as described in this tutorial.
image_recognition_tensorflow_rqt Build Status RQT tools for retraining a Tensorflow neural network.
image_recognition_util Build Status Utils shared among image recognition packages

How to

Object recognition

Step 1: label images with the image_recognition_rqt#annotation-plugin

Annotate <-- Youtube video

Step 2: train a neural network with the image_recognition_tensorflow_rqt

Train <-- Youtube video

Step 3: predict labels for new data with the image_recognition_rqt#test-plugin

Recognize <-- Youtube video

Face recognition

See the tutorial at image_recognition_openface

Face recognition <-- Youtube video

Installation

Clone the repo in your catkin_ws:

    cd ~/catkin_ws/src
    git clone https://github.com/tue-robotics/image_recognition.git

Build your catkin workspace cd ~/catkin_ws catkin_make

image_recognition's People

Contributors

ar13pit avatar dependabot[bot] avatar jannisbush avatar jlunenburg avatar josjag avatar larsjanssentue avatar loyvanbeek avatar matthijsburgh avatar maximest-pierre avatar petervdooren avatar rayman avatar reinzor avatar rokusottervanger avatar timple avatar

Stargazers

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

Watchers

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

image_recognition's Issues

Tensorflow CI failing

The tensorflow CI is probably failing because of a new tensorflow version. Sadly the Industrial CI doesn't show the installed version of pip packages.

Update: 2.12 does work, 2.13 fails

Tensorflow crash when sending empty image

Traceback (most recent call last):
  File "/home/amigo/ros/indigo/system/src/tensorflow_ros/scripts/object_recognition_node.py", line 184, in <module>
    object_recognition.update()
  File "/home/amigo/ros/indigo/system/src/tensorflow_ros/scripts/object_recognition_node.py", line 122, in update
    predictions = sess.run(result_tensor, {'DecodeJpeg/contents:0': f.read()})
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 717, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 915, in _run
    feed_dict_string, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _do_run
    target_list, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 985, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors.InvalidArgumentError: Invalid JPEG data, size 0
   [[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=3, fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_DecodeJpeg/contents_0)]]

Caused by op u'DecodeJpeg', defined at:
  File "/home/amigo/ros/indigo/system/src/tensorflow_ros/scripts/object_recognition_node.py", line 179, in <module>
    save_images_folder=save_images_folder)
  File "/home/amigo/ros/indigo/system/src/tensorflow_ros/scripts/object_recognition_node.py", line 61, in __init__
    _ = tf.import_graph_def(graph_def, name='')
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.py", line 285, in import_graph_def
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2380, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1298, in __init__
    self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Invalid JPEG data, size 0
	 [[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=3, fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_DecodeJpeg/contents_0)]]

tensorflow_ros retrain replaces underscores in labels with spaces

Hey,

If you label some images using the annotation tool, have underscores in the names of the labels and use rosrun tensorflow_ros retrain ..., the underscores will be replaced with spaces in output_lables.txt.
If you now use the object_recognition_node to test some new images, you can't just merge the unverified and verified folders afterwards to generate a new and larger training set, because the names differ (underscores vs spaces). The spaces in the labels also could lead to some other problems.

I don't know, if this is the intended behavior (because in your example underscores are used).

Inserting an underscore in line 263 in tf_retrain.py will fix this problem.
Old: label_name = re.sub(r'[^a-z0-9]+', ' ', dir_name.lower())
New: label_name = re.sub(r'[^a-z0-9_]+', ' ', dir_name.lower())

Spaces in object labels

Labels should not contain spaces, but underscores for compatibility in nl_robot_console.
One example now is the label "ice tea".

"Unknown command line flag s" when using tensorflow_ros_rqt

I was trying out this package for the first time on Ubuntu 16.04, ROS Kinetic and Tensorflow 1.8.0. First I annotated two objects with 4-5 images each using the annotation_gui. Then I ran tensorflow_ros_rqt, pointed to my image directory, and clicked the Train button but received the attached popup error window.

Not sure how to proceed from here.

Thanks!

tensorflow_ros_rqt

Shouldn't take truth value of an array

['Traceback (most recent call last):\n', ' File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/amigo/ros/kinetic/system/src/tensorflow_ros/scripts/object_recognition_node", line 73, in _recognize_srv_callback\n if predictions:\n', 'ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()\n']

object_recognition_node make nothing

Hi again .

the .pb and .txt file created successfully by train node #58
screenshot from 2018-05-28 21-35-07

now I use object_recognition_node but nothing created for me
what should I do ?
ll

and my second question is , it is possible to use this .pb file in object detection package?
https://github.com/cagbal/ros_people_object_detection_tensorflow
for example in this package ?? this package use Model Zoo of tensorflow object detection and I need to replace my own model . is it possible ? if yes please explain it

Catkin_make error

There is this catkin_make error:
CMake Error at image_recognition/image_recognition_analysis/CMakeLists.txt:14 (message):
catkin_lint failed

YOLO model download location

model = YOLO("/some/path/to/an/yolo/model/yolov8n-pose.pt")

This does work and controls the download location, so it isn't downloaded in the current working directory.

Object recognition node error

Message: Error processing request: ('Failed to run tensorflow session: %s', ValueError("Cannot feed value of shape () for Tensor u'Cast:0', which has shape '(?, ?, 3)'",))
['Traceback (most recent call last):\n', ' File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/amigo/ros/kinetic/system/src/tensorflow_ros/scripts/object_recognition_node", line 61, in _recognize_srv_callback\n sorted_result = self._recognizer.classify(self._bgr_image)\n', ' File "/home/amigo/ros/kinetic/system/src/tensorflow_ros/src/tensorflow_ros/object_recognizer.py", line 59, in classify\n raise Exception("Failed to run tensorflow session: %s", e)\n', 'Exception: ('Failed to run tensorflow session: %s', ValueError("Cannot feed value of shape () for Tensor u'Cast:0', which has shape '(?, ?, 3)'",))\n']

Conflict with openface_ros package from interaction_lab..

Thank you for your good work.

Is it correct that the ros package: openface_ros from interaction_lab is based on a completely different openface library (https://github.com/interaction-lab/openface_ros)?

As far as I understand it, there exists one openface library from the cambridge university and the one your package is based on from the cmu university. Is that right?

The package one can download using: sudo apt-get install ros-kinetic-image-recognition is based on your package right?

Best,
Max

People merging

For several RoboCup challenges, we have to deal with people and their properties.
In order to do this, the idea is to associate faces (from OpenFace) and skeletons (from OpenPose). The association can be done by assigning the skeleton who's 'nose' joint is in the bounding box of a face;s bounding box.

Then, based on that pair, we can assign other properties, such as:

  • Name
  • Age
  • Gender
  • posture: (list of string which can be 'waving', 'holding_drink', 'sitting' etc.)
  • Has_beard, has_glasses
  • Length (is_tall, is_short etc)

First step is to do this merging and then put these in ED through it;s ROS service API

Image path not set, when wanting to save images

[ERROR] [1513100614.242175]: ~save_images_folder is not defined but we would like to save images ...
Traceback (most recent call last):
File "/home/amigo/ros/kinetic/system/src/openface_ros/scripts/face_recognition_node", line 204, in
service_publish_result_image)
File "/home/amigo/ros/kinetic/system/src/openface_ros/scripts/face_recognition_node", line 50, in init
rospy.signal_shutdown()
TypeError: signal_shutdown() takes exactly 1 argument (0 given)

jetson-inference package not found

Hi,

I'm trying to compile the image_recognition_jetson package. After cloning and compiling the jetson-inference package as done in install_jetson_inference.bash, Cmake can't (fully) find the package.

So when I build the image_recognition_jetson package I get the following warnings:

CMake Warning at image_recognition/image_recognition_jetson/CMakeLists.txt:25 (find_package):
  Found package configuration file:

    /usr/local/share/jetson-inference/cmake/jetson-inferenceConfig.cmake

  but it set jetson-inference_FOUND to FALSE so package "jetson-inference" is
  considered to be NOT FOUND.  Reason given by package:

  The following imported targets are referenced, but are missing:
  jetson-utils



CMake Warning at image_recognition/image_recognition_jetson/CMakeLists.txt:35 (message):
  Jetson-inference not found, using a mock instead ...


CMake Warning at image_recognition/image_recognition_jetson/CMakeLists.txt:36 (message):
  The library can be installed using scripts/install_jetson_inference.bash

Has anyone experienced anything similar before? Any help would be appreciated.

System info:
Jetson tx2
Ubuntu 16.04
ros kinetic

Issue with Keras

[ERROR][/hero/people_recognition/face_recognition/keras_face_properties][1576613239.376740]: Error processing request: Structure is a scalar but len(flat_sequence) == 0 > 1

Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 625, in _handle_request
    response = convert_return_to_response(self.handler(request), self.response_class)
  File "/home/amigo/ros/kinetic/system/src/image_recognition_keras/scripts/face_properties_node", line 50, in _get_face_properties_srv
    estimations = self._estimator.estimate(bgr_images)
  File "/home/amigo/ros/kinetic/system/src/image_recognition_keras/src/image_recognition_keras/age_gender_estimator.py", line 51, in estimate
    results = self._model.predict(faces)
  File "/home/amigo/.local/lib/python2.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 909, in predict
    use_multiprocessing=use_multiprocessing)
  File "/home/amigo/.local/lib/python2.7/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 722, in predict
    callbacks=callbacks)
  File "/home/amigo/.local/lib/python2.7/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 410, in model_iteration
    aggregator.finalize()
  File "/home/amigo/.local/lib/python2.7/site-packages/tensorflow_core/python/keras/engine/training_utils.py", line 349, in finalize
    self.results = nest.pack_sequence_as(self._structure, self.results)
  File "/home/amigo/.local/lib/python2.7/site-packages/tensorflow_core/python/util/nest.py", line 456, in pack_sequence_as
    % len(flat_sequence))
ValueError: Structure is a scalar but len(flat_sequence) == 0 > 1

tensorflow_ros: object_recognizer.py expects the images to be RGB but receives BGR images

Hey,
Thanks for this nice library.

I was playing around with the tensorflow_ros package and was confused that my red ball was recognized as a blue ball and vice versa.
Looked into the issue and found out that evaluate_classifier, get_object_recognition and object_recognition_node all send BGR images to object_recognizer.py, but that script expects the images to be in RGB format.
The easiest solution is to transform the images to RGB in object_recognizer.py before they get send to tensorflow.

Best regards,
Jannis

Deprecated stuff in Tensorflow

W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().

Retrain failed

Hi . First at all apologize for my bad language

when I try to train my image folder an error occurs

Something went wrong during retraining, 'Unknown command line flag 's''

would you please help me .
I guess , maybe I have mistake in annotation part
1

It's annotated folder that , image_recognition_rqt make for me . is it true or no? if no what can I do for correct it?
an

Cannot write csv

Traceback (most recent call last):
File "/home/amigo/ros/kinetic/system/src/tensorflow_ros/scripts/evaluate_classifier", line 42, in
classification_score_matrix.write_to_file(args.output)
File "/home/amigo/ros/kinetic/system/src/image_recognition_util/src/image_recognition_util/classification_score_matrix.py", line 101, in write_to_file
row = dict({'ground_truth': ground_truth}, **dict(scores))
TypeError: cannot convert dictionary update sequence element #0 to a sequence

Fix CI

CI fails on installing a new version, 1.3.1, of SciPy which requires Python 3.5. Scipy 1.2.X is still compatible with Python 2.7.

Publish diagnostics

We can use the diagnostics to check if the Jetson board that runs OpenPose is performing OK or is even connected at all.

Error during testing image recognition (repeating untill specifying service&topic)

[ERROR] [1509800338.863343]: [32FC1] is not a color format. but [bgr8] is. The conversion does not make sense
[ERROR] [1509800338.863639]: bad callback: <bound method TestPlugin._image_callback of <image_recognition_rqt.test.TestPlugin object at 0x7ff759ead218>>
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
cb(msg)
File "/home/amigo/ros/kinetic/system/src/image_recognition_rqt/src/image_recognition_rqt/test.py", line 134, in _image_callback
self._image_widget.set_image(cv_image)
UnboundLocalError: local variable 'cv_image' referenced before assignment

Openpose consumes a lot of resources

Openpose is known to consume a lot of resources when run continuously.

Always having an active image subscriber/publisher even though the results are needed at low frequency drains out the battery because of exhaustive GPU use.

A proposed solution is to have additional parameter in the node that starts the node in either service only mode, or both in service and topic mode.

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.