Giter Site home page Giter Site logo

sithu31296 / pose-estimation Goto Github PK

View Code? Open in Web Editor NEW
47.0 2.0 11.0 2.36 MB

Easy to use SOTA Top-Down Multi-person Pose Estimation Models in PyTorch

License: MIT License

Python 100.00%
pose-estimation human-pose-estimation deep-learning computer-vision hrnet

pose-estimation's Introduction

Top-Down Multi-person Pose Estimation

Introduction

Pose estimation find the keypoints belong to the people in the image. There are two methods exist for pose estimation.

  • Bottom-Up first finds the keypoints and associates them into different people in the image. (Generally faster and lower accuracy)
  • Top-Down first detect people in the image and estimate the keypoints. (Generally computationally intensive but better accuracy)

This repo will only include top-down pose estimation models.

Model Zoo

COCO-val with 56.4 Detector AP
Model Backbone Image Size AP AP50 AP75 Params
(M)
FLOPs
(B)
FPS Weights
PoseHRNet HRNet-w32 256x192 74.4 90.5 81.9 29 7 25 download
HRNet-w48 256x192 75.1 90.6 82.2 64 15 24 download
SimDR HRNet-w32 256x192 75.3 - - 31 7 25 download
HRNet-w48 256x192 75.9 90.4 82.7 66 15 24 download

Note: FPS is tested on a GTX1660ti with one person per frame including pre-processing, model inference and post-processing. Both detection and pose models are in PyTorch FP32.

COCO-test with 60.9 Detector AP (click to expand)
Model Backbone Image Size AP AP50 AP75 Params
(M)
FLOPs
(B)
Weights
SimDR* HRNet-w48 256x192 75.4 92.4 82.7 66 15 download
RLEPose HRNet-w48 384x288 75.7 92.3 82.9 - - -
UDP+PSA HRNet-w48 256x192 78.9 93.6 85.8 70 16 -

Download Backbone Models' Weights (click to expand)
Model Weights
HRNet-w32 download
HRNet-w48 download

Requirements

  • torch >= 1.8.1
  • torchvision >= 0.9.1

Other requirements can be installed with pip install -r requirements.txt.

Clone the repository recursively:

$ git clone --recursive https://github.com/sithu31296/pose-estimation.git

Inference

$ python infer.py --source TEST_SOURCE --det-model DET_MODEL_PATH --pose-model POSE_MODEL_PATH --img-size 640

Arguments:

  • source: Testing sources
    • To test an image, set to image file path. (For example, assests/test.jpg)
    • To test a folder containing images, set to folder name. (For example, assests/)
    • To test a video, set to video file path. (For example, assests/video.mp4)
    • To test with a webcam, set to 0.
  • det-model: YOLOv5 model's weights path
  • pose-model: Pose estimation model's weights path

Example inference results (image credit: [1, 2]):

infer_result

References

Citations

@article{WangSCJDZLMTWLX19,
  title={Deep High-Resolution Representation Learning for Visual Recognition},
  author={Jingdong Wang and Ke Sun and Tianheng Cheng and 
          Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and 
          Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},
  journal   = {TPAMI}
  year={2019}
}

@misc{li20212d,
  title={Is 2D Heatmap Representation Even Necessary for Human Pose Estimation?}, 
  author={Yanjie Li and Sen Yang and Shoukui Zhang and Zhicheng Wang and Wankou Yang and Shu-Tao Xia and Erjin Zhou},
  year={2021},
  eprint={2107.03332},
  archivePrefix={arXiv},
  primaryClass={cs.CV}
}

pose-estimation's People

Contributors

sithu31296 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

Watchers

 avatar  avatar

pose-estimation's Issues

AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

Traceback (most recent call last):
File "infer.py", line 141, in
output = pose.predict(image)
File "/usr/local/lib/python3.8/dist-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "infer.py", line 101, in predict
pred = self.det_model(img)[0]
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/content/drive/My Drive/multipose_estimation/pose-estimation/yolov5/models/yolo.py", line 123, in forward
return self.forward_once(x, profile, visualize) # single-scale inference, train
File "/content/drive/My Drive/multipose_estimation/pose-estimation/yolov5/models/yolo.py", line 155, in forward_once
x = m(x) # run
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/upsampling.py", line 157, in forward
recompute_scale_factor=self.recompute_scale_factor)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1265, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

"the problem been solved by specific torch version"
pip install torch==1.9.0+cpu torchvision==0.10.0+cpu torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

Bug

Screenshot from 2022-09-22 16-21-10
Hello I have a bug when running imshow video and this only hint first frame and stop. How can fix them. Thank you

bug修复

在infer.py中,第37行存在一个bug:cv2.line()函数中坐标参数需要为元组形式,因此需要对tuple(kpts[kid1-1])
bug

Questions..

Where is the part that passes from the yolo box value to the pose? How can I apply the pose code?

infer

When I run infer.py, the following error occurs:
Traceback (most recent call last):
File "D:/UserData/yanhan/RE-ID CO/pose-estimation-main/pose-estimation-main/infer.py", line 133, in
output = pose.predict(image)
File "D:\Users\TEMP.conda\envs\pytorch_gpu1\lib\site-packages\torch\autograd\grad_mode.py", line 26, in decorate_context
return func(*args, **kwargs)
File "D:/UserData/yanhan/RE-ID CO/pose-estimation-main/pose-estimation-main/infer.py", line 102, in predict
self.postprocess(pred, img, image)
File "D:/UserData/yanhan/RE-ID CO/pose-estimation-main/pose-estimation-main/infer.py", line 96, in postprocess
draw_keypoints(img0, coords, self.coco_skeletons)
File "D:\UserData\yanhan\RE-ID CO\pose-estimation-main\pose-estimation-main\pose\utils\utils.py", line 37, in draw_keypoints
cv2.line(img, kpts[kid1-1], kpts[kid2-1], (0, 255, 0), 2, cv2.LINE_AA)
SystemError: new style getargs format but argument is not a tuple

What is the reason?
thanks.

UDP+PSA

thanks for u code!what about this model?UDP+PSA,do u want to do this

how to fix this ?

  File "infer.py", line 164, in <module>
    output = pose.predict(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
  File "C:\Users\ASUS\anaconda3\envs\test_tf\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "infer.py", line 102, in predict
    self.postprocess(pred, img, image)
  File "infer.py", line 96, in postprocess
    draw_keypoints(img0, coords, self.coco_skeletons)
  File "D:\Work\Codes\pose-estimation-main\pose\utils\utils.py", line 37, in draw_keypoints
    cv2.line(img, kpts[kid1-1], kpts[kid2-1], (0, 255, 0), 2, cv2.LINE_AA)
SystemError: new style getargs format but argument is not a tuple

used with file as well as webcam, same error !

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.