[PYTHON] Make Alpha Pose ROS (Implement Pose Tracking in ROS)

Introduction

What is AlphaPose? (Https://github.com/MVIG-SJTU/AlphaPose)

  1. ** I want to run AlphaPose with ROS. ** (I want to implement Pose Tracking in ROS)
  2. I made a code that works for the time being (https://github.com/yone-moto/AlphaPose_ros.git), but since it is a beta version and there are many corrections, I will improve the code by publishing it as soon as possible. Want to. That is the motivation.

What is Alpha Pose

It is a deep learning tool ** that estimates the postures of multiple ** people in an image or video. There are many deep learning tools other than AlphaPose that can estimate the posture of a person. Among them, the difference from the most major OpenPose is ・ Realtime will do ** Pose Tracking **. ・ A type of Human Pose Optimization, AP is superior to ** OpenPose. ** ** ・ ** Top-down approach **. I understand that. This time I wanted to implement Pose estimation and Tracking, so I chose AlphaPose.

environment

ubuntu16.04 ROS version kinetic That is the place. The rest is an environment where AlphaPose works.

Alpha Pose ROS

Addition of functions

AlphaPose publishes api script, but compared to my request ・ ** Since it is an API that supports images, it does not support videos. ** ** ・ ** No tracking implementation. ** There was no such thing, so I added it. Code here (Alphapose_ros.py) It's not optimized because it feels like it should work.

Python version issue

Kinetic is python2 by default, so it supports Python3. .. .. (I want to make it ROS2 or noetic soon ...) So, when making a node with ROS, I referred to here and made it work with Python3 in the disguise environment created with AlphaPose.

When I brought the image from the webcam, I tried to make it topic using cv_brige from python3, but apparently it is necessary to rebuild cv_brige to support python3 system, and in the disguise environment it is with other libraries Coexistence did not work. Refer to here After a lot of research, I found that CompressedImage is compatible with python3, so I used this to receive image topics from webcam in python3. Refer to here

How to move

Since it is pkg, put it directly under src.

catkin_ws/src/ $ git clone https://github.com/yone-moto/AlphaPose_ros.git
catkin_ws/ $ catkin_make
######Ready / executed######
catkin_ws/src/ $ roslaunch alphapose_ros alphapose_demo.launch
(alphapose) (path to)AlphaPose_ros/scripts/$./alphapose.sh

result

** Poseestimation (visualized with Rviz) ** スクリーンショット 2021-01-02 21.09.24.png

There is only one video and tracking cannot be shown. .. .. It is intentional that only the right half is painted, and the left half is also output.

option

I really wanted to show tracking, so I calculated the speed vector (direction of travel of the person) in combination with the rider. Like this スクリーンショット 2021-01-02 21.34.44.png

that's all. Thank you for watching until the end. ** I would like to continue to add or modify this article and code! !! !! !! And I want to be more useful in the world. ** **

Recommended Posts

Make Alpha Pose ROS (Implement Pose Tracking in ROS)
Calculate Pose and Transform differences in Python with ROS
Implement recommendations in Python
Implement XENO in python
Implement sum in Python
Implement Traceroute in Python 3