Giter VIP home page Giter VIP logo

real-time-action-recognition's Introduction

Real-Time-Action-Recognition

Real-time pose estimation and action recognition

Openpose weight file is collected from tf-pose-estimation, thank for ildoonet's awesome work.

Old version

Old version detects person using SSD then classify images.

The old version is in old branch

requirements

Using Anaconda is recommended.

opencv

pip install opencv-python

tensorflow1.3

pip install tensorflow-gpu==1.3.0

filterpy

pip install filterpy

usage

python run.py

results

pose estimation

tf-pose-estimation

pose1

pose2

multi-person tracking

Using sort to track person.

track1

track2

action recognition

action1

action2

reference

tf-pose-estimation

sort

real-time-action-recognition's People

Contributors

tianzhongsong 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  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

real-time-action-recognition's Issues

3 FPS. while using GPU

Why it's so slow in real time and I'm using GPU to run the software?
Can you improve the speed of the model

读取graph_opt.pb出错

f=tf.gfile.GFile(graph_path, 'rb') #graph_path 我已经修改为我本机上该文件的路径
f.read()


f= tf.gfile.GFile(graph_path, 'rb')
f.read()
Traceback (most recent call last):

File "D:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2927, in run_code
self.showtraceback(running_compiled_code=True)

File "D:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 1833, in showtraceback
self._showtraceback(etype, value, stb)

File "D:\ProgramData\Anaconda3\lib\site-packages\ipykernel\zmqshell.py", line 558, in _showtraceback
dh.parent_header, ident=topic)

File "D:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\session.py", line 737, in send
to_send = self.serialize(msg, ident)

File "D:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\session.py", line 625, in serialize
content = self.pack(content)

File "D:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\session.py", line 103, in
ensure_ascii=False, allow_nan=False,

File "D:\ProgramData\Anaconda3\lib\site-packages\zmq\utils\jsonapi.py", line 43, in dumps
s = s.encode('utf8')

UnicodeEncodeError: 'utf-8' codec can't encode character '\udcd5' in position 1402: surrogates not allowed

About PoseRec

Hi, 非常好的项目, 我正在尝试着做一个坐姿头朝前或向左向右三种姿势判断的项目, 目前用三种姿势的骨骼图像训练出来的模型测试效果并不是太理想, 单纯的只想完成上半身头部的一些姿势判断, 现在有些摸不着方向, 能不能给我一些建议,谢谢啦。

导入scipy模块出错

您好,我看了您写的代码,我本人也在研究人体异常行为的检测问题。在您写的代码中,我运行了estimator.py这个文件,但是系统却报错了,提示scipy模块导入错误,显示为ImportError: No module named 'numpy.core._multiarray_umath',所以我想知道您编写代码的时候,用的是scipy的哪一个版本?或者您知道这样的错误应该从哪儿解决吗?十分感谢您的帮助!

ask question

Dear author, when I am reproducing your model, after executing run.py, click on the camera, and then set the human body motion recognition. There is no text appearing, only the frame of the line. I would like to ask you if you have any solutions

Multiple Object Tracking not working

Hi, thank you for your work it is really interesting! I have a small problem with running the code. Everything works fine but when i press the "Multiple Object Tracking" button to "ON", the program quits with the error:
File "run.py", line 171, in show_camera
show, joints, bboxes, xcenter = TfPoseEstimator.get_skeleton(show, humans, imgcopy=False)
ValueError: too many values to unpack (expected 4)
Abort trap: 6
Any way to resolve this issue?
Thanks!

Error while running run.py

python main.py
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/sarthak/anaconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "main.py", line 6, in
from utils import choose_run_mode, load_pretrain_model, set_video_writer
File "/home/sarthak/Major Project/Online-Realtime-Action-Recognition-based-on-OpenPose/utils.py", line 6, in
from Pose.pose_visualizer import TfPoseVisualizer
File "/home/sarthak/Major Project/Online-Realtime-Action-Recognition-based-on-OpenPose/Pose/pose_visualizer.py", line 6, in
from .pose_estimator import estimate
File "/home/sarthak/Major Project/Online-Realtime-Action-Recognition-based-on-OpenPose/Pose/pose_estimator.py", line 21, in
'coord1', 'coord2', 'score1', 'score2'], verbose=False)
TypeError: namedtuple() got an unexpected keyword argument 'verbose'

move_status 里的 parameter

你好,

请问在 move_status( action.py) 里的h1,h2,ty 等等代表着什么意思?? (比如 xc 和 yc 是代表格子的长和宽??h1 是人的高度/ ratio?? 如何得到那些比较大小的数字? )
如果能明白这些,那就可以用来辨别更多动作。(比如我需要辨别倒下的动作。)

另外, 如果说我想辨别 举手的动作, 请问我可不可以用手肘的点高于肩膀(或和头的点并行)来进行判断?? (看了其他回复,但还是不明白, 对不起)

真心希望你能帮忙, 谢谢。

Coordinates of the joints

Hi

Can you please tell me how to fetch the coordinates of each joint especially the coordinates of Right Wrist and Left Wrist of our hands.

Regards
Akhil

Error while compilation

Hi Without modifying your code I just compiled it but getting this error.
Any help will be appreciated.(tensorflow_p36) ubuntu@ip-172-31-62-23:~/Real-Time-Action-Recognition$ python run.py
/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "run.py", line 5, in
from utils.sort import Sort
File "/home/ubuntu/Real-Time-Action-Recognition/utils/init.py", line 1, in
from . import processing
ImportError: cannot import name 'processing'

PyQt5 Error

Hi

While compiling the program I am facing this below issue:

Traceback (most recent call last):
File "run.py", line 3, in
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: /usr/local/lib/python3.5/dist-packages/PyQt5/QtCore.so: undefined symbol: PySlice_AdjustIndices

This issue is also reproducible with the simple QT application as well.
Can you please guide me here

Thanks in Advance !!!!!

Regards
Akhil

关于姿态估计模型

你好,感谢您的分享,我在实验中发现您使用的tf_pose中的thin模型,不知道有没有常识cmu原来的模型进行行为识别,如果我需要改成那个的话,不知道需要在您的基础上怎么修改,希望得到您的指教 @TianzhongSong

动作识别的模型有参考文献吗

你好,action部分的代码原理能解释一下吗,还有根据关键点做动作识别方面有没有什么简单,效果还说得过去的模型,想做个这方面的简单应用~

Pretrained model

Can you please share weights_c3d_mask.h5 and weights_SSD300.h5?

how to run the old branch code

Hi

I am trying few things for the action recognition for my academic purpose and my area of study is 3DCNN and in your old branch code you have used the 3DCNN as well.

I have one Query which file I should run to execute the source code (There is no run.py file)

Thanks in Advance !!!!!

Regards
Akhil

Tensorflow issue and compiling issue

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 3, in
from pose.estimator import TfPoseEstimator
File "/content/Real-Time-Action-Recognition/pose/estimator.py", line 8, in
import tensorflow as tf
File "/usr/local/lib/python3.6/dist-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

ValueError: cannot convert float NaN to integer

大神 你好:
我运行 Python run.py的时候 模式一 “当前为人体姿态估计模式” 功能正常

但是,运行功能三的时候 ,相机能够打开,但是一旦检测到人物 就错误提示:

Traceback (most recent call last):
File "run.py", line 231, in show_camera
xmin = int(d[0])
ValueError: cannot convert float NaN to integer
Aborted (core dumped)

我将trackers输出得到:

trackers= [[nan nan nan nan 1.]]

我以为是numpy转换出了问题, 我就手动转换 加了一句:trackers = np.nan_to_num(trackers)
这下相机能够打开,功能三也不卡核,但是也没有结果,我输出了一些参数:

检测到人的情况:
trackers= []
show= <type 'numpy.ndarray'>
humans= [<pose.estimator.Human instance at 0x7f67df2fa0e0>]
bboxes= [[0.0, 0.0, 0.0, 0.0, 0.9999]]
trackers= []
show= <type 'numpy.ndarray'>
humans= [<pose.estimator.Human instance at 0x7f67df2fa4d0>]
bboxes= [[0.0, 0.0, 0.0, 0.0, 0.9999]]
trackers= []
show= <type 'numpy.ndarray'>
humans= [<pose.estimator.Human instance at 0x7f67df2fa2d8>]
bboxes= [[0.0, 0.0, 0.0, 0.0, 0.9999]]
trackers= []

没有检测到人的情况:
humans= []
bboxes= []
show= <type 'numpy.ndarray'>
humans= []
bboxes= []
show= <type 'numpy.ndarray'>
humans= []
bboxes= []
show= <type 'numpy.ndarray'>
humans= []
bboxes= []
show= <type 'numpy.ndarray'>
humans= []

结果就是空值,请大神指点,不胜感激

Train on Custom Dataset

Thanks for nice work . I am doing same type of action recognition but my classes are different. I have four classes "waving" ,"clapping" and pointing . I have 300 videos for every class . Can u guide me and tell me the exact process of training of my own custom data to this technique . Thanks

can you share your idea or papper

你好!
你的工作非常有意义! 我现在也想做这方面的研究,我现在已经可以通过网络定位出图片中人体骨骼点的位置。但是在视屏中如何认别出动作,比如站起/走开/坐下?我就没什么思路了。所以想请你指导下!
谢谢!

行为识别 error

Hi, when I use 行为识别, I got an error, below

/home/wade/Desktop/Real-Time-Action-Recognition/utils/sort.py:37: RuntimeWarning: invalid value encountered in double_scalars
r = w / float(h)
('trackers', array([[nan, nan, nan, nan, 1.]]))
Traceback (most recent call last):
File "run.py", line 218, in show_camera
xmin = int(d[0])
ValueError: cannot convert float NaN to integer
Aborted (core dumped)

Could you help, please

ZeroDivisionError: float division by zero

hi guys,
when i run run.py, this issue:
Traceback (most recent call last):
File "run.py", line 258, in show_camera
self.fps = 0 / (end - start)
ZeroDivisionError: float division by zero

and it's crashed python.

Anyone. Can you help me? thanks

训练结果

能不能提供一下您现在的 weights_c3d_mask.h5和cnn_2d_crop.h5,所找的数据集有点不太行,如果可以的话请发到[email protected]邮箱,谢谢

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.