Coder Social home page Coder Social logo

pytorch-pose-hg-3d's Introduction

Towards 3D Human Pose Estimation in the Wild: a Weakly-supervised Approach

This repository is the PyTorch implementation for the network presented in:

Xingyi Zhou, Qixing Huang, Xiao Sun, Xiangyang Xue, Yichen Wei, Towards 3D Human Pose Estimation in the Wild: a Weakly-supervised Approach ICCV 2017 (arXiv:1704.02447)

Note: This repository has been updated and is different from the method discribed in the paper. To fully reproduce the results in the paper, please checkout the original torch implementation or our pytorch re-implementation branch (slightly worse than torch). We also provide a clean 2D hourglass network branch.

The updates include:

  • Change network backbone to ResNet50 with deconvolution layers (Xiao et al. ECCV2018). Training is now about 3x faster than the original hourglass net backbone (but no significant performance improvement).
  • Change the depth regression sub-network to a one-layer depth map (described in our StarMap project).
  • Change the Human3.6M dataset to official release in ECCV18 challenge.
  • Update from python 2.7 and pytorch 0.1.12 to python 3.6 and pytorch 0.4.1.

Contact: [email protected]

Installation

The code was tested with Anaconda Python 3.6 and PyTorch v0.4.1. After install Anaconda and Pytorch:

  1. Clone the repo:

    POSE_ROOT=/path/to/clone/pytorch-pose-hg-3d
    git clone https://github.com/xingyizhou/pytorch-pose-hg-3d POSE_ROOT
    
  2. Install dependencies (opencv, and progressbar):

    conda install --channel https://conda.anaconda.org/menpo opencv
    conda install --channel https://conda.anaconda.org/auto progress
    
  3. Disable cudnn for batch_norm (see issue):

    # PYTORCH=/path/to/pytorch
    # for pytorch v0.4.0
    sed -i "1194s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py
    # for pytorch v0.4.1
    sed -i "1254s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py
    
  4. Optionally, install tensorboard for visializing training.

    pip install tensorflow
    

Demo

  • Download our pre-trained model and move it to models.
  • Run python demo.py --demo /path/to/image/or/image/folder [--gpus -1] [--load_model /path/to/model].

--gpus -1 is for CPU mode. We provide example images in images/. For testing your own image, it is important that the person should be at the center of the image and most of the body parts should be within the image.

Benchmark Testing

To test our model on Human3.6 dataset run

python main.py --exp_id test --task human3d --dataset fusion_3d --load_model ../models/fusion_3d_var.pth --test --full_test

The expected results should be 64.55mm.

Training

  • Prepare the training data:

    ${POSE_ROOT}
    |-- data
    `-- |-- mpii
        `-- |-- annot
            |   |-- train.json
            |   |-- valid.json
            `-- images
                |-- 000001163.jpg
                |-- 000003072.jpg
    `-- |-- h36m
        `-- |-- ECCV18_Challenge
            |   |-- Train
            |   |-- Val
            `-- msra_cache
                `-- |-- HM36_eccv_challenge_Train_cache
                    |   |-- HM36_eccv_challenge_Train_w288xh384_keypoint_jnt_bbox_db.pkl
                    `-- HM36_eccv_challenge_Val_cache
                        |-- HM36_eccv_challenge_Val_w288xh384_keypoint_jnt_bbox_db.pkl
    
  • Stage1: Train 2D pose only. model, log

python main.py --exp_id mpii
  • Stage2: Train on 2D and 3D data without geometry loss (drop LR at 45 epochs). model, log
python main.py --exp_id fusion_3d --task human3d --dataset fusion_3d --ratio_3d 1 --weight_3d 0.1 --load_model ../exp/mpii/model_last.pth --num_epoch 60 --lr_step 45
  • Stage3: Train with geometry loss. model, log
python main.py --exp_id fusion_3d_var --task human3d --dataset fusion_3d --ratio_3d 1 --weight_3d 0.1 --weight_var 0.01 --load_model ../models/fusion_3d.pth  --num_epoch 10 --lr 1e-4

Citation

@InProceedings{Zhou_2017_ICCV,
author = {Zhou, Xingyi and Huang, Qixing and Sun, Xiao and Xue, Xiangyang and Wei, Yichen},
title = {Towards 3D Human Pose Estimation in the Wild: A Weakly-Supervised Approach},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
month = {Oct},
year = {2017}
}

pytorch-pose-hg-3d's People

Contributors

xingyizhou 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  avatar

pytorch-pose-hg-3d's Issues

PyTorch version

Hi, tried unpickling from Python 2 to Python 3 as below, and it works:

from functools import partial
import pickle

pickle.load = partial(pickle.load, encoding="latin1")
pickle.Unpickler = partial(pickle.Unpickler, encoding="latin1")


def main():
  opt = opts().parse()
  if opt.loadModel != 'none':
    model = torch.load(opt.loadModel).cuda()
  else:
    model = torch.load('hgreg-3d.pth', map_location=lambda storage, loc: storage, pickle_module=pickle).cuda()
...

After this, I'm not getting any luck with the provided model with PyTorch 0.4.0 and 0.4.1:

AttributeError: 'BatchNorm2d' object has no attribute 'track_running_stats'

and even after downgrading to 0.1.12:

AttributeError: Can't get attribute 'Upsample' on <module 'torch.nn.modules.upsampling' ...

What's the exact version of PyTorch that I should be working with? Thanks.

Pre-trained model performing badly on MPI-INF 3D HP

The pre-trained model linked here is not giving the reported accuracy for MPI-INF. (200 MPJPE on test set)
But the pre-trained model for lua is working as expected (124 MPJPE on test set)

3D regressor isn't working as expected

About pytorch version

Hi, Thanks for your great work. Which version of pytorch do you use ? I am using pytorch 0.4 on python2.7.
I got an error when I try to run the demo script.
image

pre processing for mpii dataset for 2d version

Hi @xingyizhou ,

I was trying out the 2D pre-trained model given by you on mpii images,

I'm getting the following error

Traceback (most recent call last):
  File "demo.py", line 37, in <module>
    main()
  File "demo.py", line 26, in main
    output = model(input_var)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 106, in forward
    hg = self.hourglass[i](x)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 56, in forward
    return up1 + up2
RuntimeError: The size of tensor a (15) must match the size of tensor b (14) at non-singleton dimension 2

I think there is some preprocessing to be done on mpii, any clues?

(P.S : I adopted the demo.py from 3D version)

Demo error - 'BatchNorm2d' object has no attribute 'track_running_stats'

Hi,

I'am using torch version 0.5 and i get that error in that line

output = model(input_var)

The error message looks like that:

  File "src/demo.py", line 26, in main
    output = model(input_var)
  File "/home/narvis/miniconda3/envs/hpe/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/narvis/Dev/pytorch-pose-hg-3d/src/models/hg_3d.py", line 101, in forward
    x = self.bn1(x)
  File "/home/narvis/miniconda3/envs/hpe/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/narvis/miniconda3/envs/hpe/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 66, in forward
    self.training or not self.track_running_stats,
  File "/home/narvis/miniconda3/envs/hpe/lib/python3.6/site-packages/torch/nn/modules/module.py", line 518, in __getattr__
    type(self).__name__, name))
AttributeError: 'BatchNorm2d' object has no attribute 'track_running_stats'

I found that other repositories have similar issues when upgrading from torch 0.3 to 0.4:
kunglab/ddnn#2

And I checked the specific commit to find out how to solve this errorr: kunglab/ddnn@071c82f

But I couldn't find the right solution yet.

I would like to use the most recent torch version so downgrading is not really an option for me.

Why self define FusionCriterion function?

Hi, thanks for your great work. May I ask why do you write FusionCriterion function with forward pass and backward pass on your own? As far as I know, the forward pass is already differentiable, Pytorch itself can handle the backward pass, right? Is there something important that I was missing?
In this link https://discuss.pytorch.org/t/how-to-use-condition-flow/644/3 , using Variable.data is still a safe operation in building a graph.
Looking for your reply, Thanks.

Question:result of stage1 model to estimate 3d depth is different?

Hello, Zhou,
I trained 2D Hourglass Module by your code with 60 epoch, when I was training stage2, the output of depth regress module is very large at the beginning(such as [5000, 122, -13984 ...] and so on) ; But when I used model_60.th you have provided, when I was training stage2, the output of depth regress module is very small at the beginning(such as [0.11, -0.03, 0.43,....., 123]), it doesn't occur large numbers. Why? Look forward your reply.

Error Demo CPU, not CUDA

I use CPU, not GPU, not CUDA.
I use Anaconda, Spider to build demo.py. I had a error:

File "C:\Users\user\Anaconda3\envs\tensorflow\lib\site-packages\torch\serialization.py", line 78, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.

Can you help me?

An question about average sum-of-skeleton-length.

Hello, xingyizhou.
I am interseted about this project and I have a question about how to compute the average sum-of-skeleton-length.
According to your paper, it is calculated over all the training subjects. But as we all know, the skeleton length difference between different people is huge. For example, a male's skeleton length is longer than a female's in average.
So when you calaulate the MPJPE over the validation dataset, how could you ensure this average skeleton-length is suitable for the subjects, S9 and S11?
Waiting for your answer.

why do you set nModules to 2?

I wonder why you set nModules(residual modules at each hourglass) to 2 rather than 1? Is there any special effect?

How to mapping from xy in joint_2d to x'y' in joint_3d_mono?

Hi, is there any relationship between x,y in pts and x,y in pts_3d_mono?
The model output x,y is in pts, but the ground truth is in pts_3d_mono. So I want to figure out whether there is a mapping. Thanks!

def GetPartInfo(self, index):
pts = self.annot['joint_2d'][index].copy()
pts_3d_mono = self.annot['joint_3d_mono'][index].copy()
pts_3d = self.annot['joint_3d_mono'][index].copy()

Error in loading state_dict for PoseResNet

Hi,
I want to use the weight I trained in stage 1 and continue training in stage 2, but it has runtime error.
RuntimeError: Error(s) in loading state_dict for PoseResNet:
Missing key(s) in state_dict: "depth.weight", "depth.bias".
Do you have any idea can solve this problem?

Thanks!

The evaluation strategy (PCKh)

Thanks for the exciting code!
But, I'm a little confused with the evaluation strategy of PCKh.
Here is the code (at 'src/utils/eval.py: line 33'):

# PCKh0.5
def Accuracy(output, target):
    preds = getPreds(output)
    gt = getPreds(target)
    # ref.outputRes = 64
    dists = calcDists(preds, gt, np.ones(preds.shape[0]) * ref.outputRes / 10)
    acc = np.zeros(len(ref.accIdxs))
    avgAcc = 0
    badIdxCount = 0

    for i in range(len(ref.accIdxs)):
        acc[i] = distAccuracy(dists[ref.accIdxs[i]])
        if acc[i] >= 0:
            avgAcc = avgAcc + acc[i]
        else:
            badIdxCount = badIdxCount + 1

    if badIdxCount == len(ref.accIdxs):
        return 0
    else:
        return avgAcc / (len(ref.accIdxs) - badIdxCount)

the calcDists function calculates the normalized distances of each predicted joint with ground truth. if we used PCKh [M. Andriluka, L. Pishchulin, P. Gehler, and B. Schiele. 2D human pose estimation: New benchmark and state of the art analysis. In CVPR, 2014. 6, 7] as the evaluation strategy,the normalize should be the head size.
But I noticed that the normalize is a matrix with the fixed value (=6.4) not the size of the head.
So, why use the fixed value to replace the head size?
Thanks 😃

Why effect is very poor use model by

Why do I trained model effect is very poor

According to the training you provide code, and test results as shown

The z axis data clearly wrong, what should I do how to adjust?

0.1.12 pytorch - the gpu version

Training time question

Hi, thx for your awesome work! @xingyizhou
I'm trying to repeat your exp. I rewrite some part of your main function, however, didn't change your dataset and model.
I find it is quite slow to train the net(more than two day training on single TITAN xp, for stage 2)
I wonder if I make some mistakes. Could you tell me how much time did you spend on training the stage2 and stage3?
:)

Questions about training

I have no problem running the demo of the test.But when I run the "python main.py -expID Stage1",I have encountered the following problem:
**
THCudaCheck FAIL file=d:\pytorch\pytorch\torch\lib\thc\generic/THCTensorMathPointwise.cu line=606 error=30 : unknown error
Traceback (most recent call last):
File "H:/SZS/pytorch-pose-hg-3d-v0.0/src/main.py", line 84, in
main()
File "H:/SZS/pytorch-pose-hg-3d-v0.0/src/main.py", line 65, in main
loss_train, acc_train, mpjpe_train, loss3d_train = train(epoch, opt, train_loader, model, criterion, optimizer)
File "H:\SZS\pytorch-pose-hg-3d-v0.0\src\train.py", line 61, in train
return step('train', epoch, opt, train_loader, model, criterion, optimizer)
File "H:\SZS\pytorch-pose-hg-3d-v0.0\src\train.py", line 51, in step
optimizer.step()
File "D:\anaconda\envs\Pytorch3\lib\site-packages\torch\optim\rmsprop.py", line 75, in step
square_avg.mul_(alpha).addcmul_(1 - alpha, grad, grad)
RuntimeError: cuda runtime error (30) : unknown error at d:\pytorch\pytorch\torch\lib\thc\generic/THCTensorMathPointwise.cu:606
**
I have no idea about it. Would you help me?

Xorg memory leak

Hi,
I want to use your code to predict the coordinate of images, so I modify your demo code to make it save the pose information.
But I found that the Debugger() will cause Xorg memory leak.
Do you have any idea can help me to solve this problem?

Thanks!

Testing

Testing
Download our pre-trained model and move it to models.
Run python demo.py -demo /path/to/image [-loadModel /path/to/image].

Kindly please define again how to run testing side. I have downloaded the pre-trained model and moved to models folder. Then I have to run demo.py which is in src folder? Am I right?

pose estimation in video

Is this code work for video? I give a video to code. it is giving following error:
Traceback (most recent call last):
File "demo.py", line 31, in
main()
File "demo.py", line 17, in main
input = torch.from_numpy(img.transpose(2, 0, 1)).float() / 256.
AttributeError: 'NoneType' object has no attribute 'transpose'

Runtime error

When trying to run the demo I get:
File "/media/ssddata/harald/code/Movement/motion_map/test/pytorch-pose-hg-3d/src/models/hg_3d.py", line 57, in forward
return up1 + up2
RuntimeError: The size of tensor a (5) must match the size of tensor b (4) at non-singleton dimension 2

Any idea what I might be doing wrong?

Error Benchmark Testing

dear,
I use CPU, not GPU, not CUDA.
I use Anaconda, Spider to build main.py. I had a error:
I met the error like that
image
Can you help me?

Question about dataset MPII

I have downloaded the MPII dataset, but what should I do to generate the .H5 file?
Here are the problems I encountered during training.
**
f = File('{}/mpii/annot/{}.h5'.format(ref.dataDir, split), 'r')
File "D:\anaconda\envs\Pytorch3\lib\site-packages\h5py_hl\files.py", line 312, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "D:\anaconda\envs\Pytorch3\lib\site-packages\h5py_hl\files.py", line 142, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5f.pyx", line 78, in h5py.h5f.open
**

the pre-trained model can't achieve 88.38% validation accuracy

Hi, xingyi,
I use your codes and load the pre-trained model you provided. But I can only achieve 85.789% on the validation set without training, while you said it is 88.38% accuracy. After training for 30+ epochs, the validation accuracy is around 86%. I think the validation set is fixed, no random split, so the accuracy should be the same. Why does that happen?
default
Thanks a lot!

dead in train

你好xingyi,我尝试用你的pose-hg-2d进行训练mpii数据集,我把所有的config都配置好了,数据也下载了。前期导入都没有问题,但是每次都在train.py中的第21行出bug,“for i, (input, target, meta) in enumerate(dataLoader):”。我在这句的后面加print函数,都不能显示出来。后来我在MPii.py的__getitem__(),LoadImage()和GetPartInfo()加了一些print,结果如下:
(env_py27) ccc@bj:~/case/hourglass/pytorch-pose-hg-2d/src$ python main.py -expID 2D -GPU 3 ~/anaconda3/envs/env_py27/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from floattonp.floatingis deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters

Using GPU 3

==> initializing 2D val data.

Loaded 2D val 2958 samples

==> initializing 2D train data.

Loaded 2D train 22246 samples

('len(dataLoader) is %d', 3708)

prepare to in dataLoader

~/case/hourglass/Datasets/mpii/images/085460756.jpg
9384 pts.shape is (16, 2)
9384 c.shape is (2,)
9384 s.shape is ()
self.split is train

~/case/hourglass/Datasets/mpii/images/019372879.jpg
18030 pts.shape is (16, 2)
18030 c.shape is (2,)
18030 s.shape is ()
self.split is train`
每次都只显示2张或4张图片信息,不管我设置trainBatch是1还是5还是10。曾经有两次我通过了“for i, (input, target, meta) in enumerate(dataLoader):”,但是在后面停止,不能训练了。不知道你之前遇到过这个问题吗?
谢谢,不胜感激!

Q: scaling in 3D

Hi,

I was wondering if you can please help me understand the reasoning behind this code.
`

pts_3d = pts_3d - pts_3d[self.root]
s2d, s3d = 0, 0
for e in ref.edges:
  s2d += ((pts[e[0]] - pts[e[1]]) ** 2).sum() ** 0.5
  s3d += ((pts_3d[e[0], :2] - pts_3d[e[1], :2]) ** 2).sum() ** 0.5
scale = s2d / s3d
  
for j in range(ref.nJoints):
  pts_3d[j, 0] = pts_3d[j, 0] * scale + pts[self.root, 0]
  pts_3d[j, 1] = pts_3d[j, 1] * scale + pts[self.root, 1]
  pts_3d[j, 2] = pts_3d[j, 2] * scale + ref.h36mImgSize / 2`

A) If I understand correctly, it is that all coordinates in pts_3d will be of the same order of magnitude. Am I correct?
B) What is the reason behind multiplying by the scale factor in the last three rows?
C) Why is root location not multiplied by the same factor,
D) why ref.h36mImgSize / 2 is the offset for the z coordinate?

Demo.py issue: 'ascii' codec can't decode byte 0xc3 in position 875

Hey, trying to run the demo, I'm receiving the following error. Any suggestions on how to fix it? Thank you!

(base) D:\xx\Pose\src>python demo.py -demo images/h36m_1214.png
Traceback (most recent call last):
File "demo.py", line 31, in
main()
File "demo.py", line 15, in main
model = torch.load('hgreg-3d.pth').cuda()
File "C:\Users\xx\Anaconda3\lib\site-packages\torch\serialization.py", line 303, in load
return _load(f, map_location, pickle_module)
File "C:\Users\xx\Anaconda3\lib\site-packages\torch\serialization.py", line 469, in _load
result = unpickler.load()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 875: ordinal not in range(128)

MPJPE using the ground truth heatmaps is 17-18

Hi,
If we try to evaluate MPJPE using the ground truth heatmaps and ground truth z coordinates that are used for regressing then we get it about 17/18.
I think this is because of the perspective projections and the average human bone length ration that is used, but 17/18 is pretty high right?
Any opinions??

test demo problem

Hi,
thanks for your code, but I have a problem when I run to demo,

(Human_Pose) gaojie@ubuntu:$ cd human_pose/pytorch-pose-hg-3d/
data/ .git/ images/ readme.md
exp/ .gitignore LICENSE src/
(Human_Pose) gaojie@ubuntu:
$ cd human_pose/pytorch-pose-hg-3d/src/
(Human_Pose) gaojie@ubuntu:/human_pose/pytorch-pose-hg-3d/src$ cd models/
(Human_Pose) gaojie@ubuntu:
/human_pose/pytorch-pose-hg-3d/src/models$ ls
hg_3d.py hgreg-3d.pth init.py layers
(Human_Pose) gaojie@ubuntu:/human_pose/pytorch-pose-hg-3d/src/models$ cd ..
(Human_Pose) gaojie@ubuntu:
/human_pose/pytorch-pose-hg-3d/src$ ls
datasets demo.py models pycache tools utils
debug main.py opts.py ref.py train.py
(Human_Pose) gaojie@ubuntu:/human_pose/pytorch-pose-hg-3d/src$ python demo.py -demo /path/to/image [-loadModel /path/to/image]
usage: demo.py [-h] [-expID EXPID] [-test] [-DEBUG DEBUG] [-demo DEMO]
[-loadModel LOADMODEL] [-nFeats NFEATS] [-nStack NSTACK]
[-nModules NMODULES] [-LR LR] [-dropLR DROPLR]
[-nEpochs NEPOCHS] [-valIntervals VALINTERVALS]
[-trainBatch TRAINBATCH] [-nRegModules NREGMODULES]
[-ratio3D RATIO3D] [-regWeight REGWEIGHT]
[-varWeight VARWEIGHT]
demo.py: error: unrecognized arguments: [-loadModel /path/to/image]
(Human_Pose) gaojie@ubuntu:
/human_pose/pytorch-pose-hg-3d/src$

H3.6M preprocessing code

Hi,

I was wondering if you can share (possibly privately) the preprocessing code that was used to obtain the preprocessed H3.6M figures and positions.

Thanks!

Test inference of model on cpu and python3

I would like to test the trained model in python 3 and on cpu.
Right now I'm having issues with loading the model.

Traceback (most recent call last):
File "demo.py", line 31, in
main()
File "demo.py", line 13, in main
model = torch.load(opt.loadModel).cuda()
File "/home/hdbondt/miniconda3/lib/python3.6/site-packages/torch/serialization.py", line 231, in load
return _load(f, map_location, pickle_module)
File "/home/hdbondt/miniconda3/lib/python3.6/site-packages/torch/serialization.py", line 379, in _load
result = unpickler.load()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 875: ordinal not in range(128)

Is there by any chance a trained version compatible with python3?

the geometric constraint question

image
@xingyizhou ,您好,我在查看您的代码的时候,发现这里使用的计算bone length的时候,使用的似乎不是paper里说的2D pose的gt, 使用的似乎也是detect的2D pose??

A request: MPII-INF-3DHP

Hi Xingyi.

Can you please make available either the post-processed MPII-INF-3DHP or the script you have used in order to pre-process it?

Thanks!

preprcossing code in mpii.py

Maybe the range for color augmentation is wrong?

inp[0] = np.clip(inp[0] * (np.random.random() * (0.4) + 0.6), 0, 1)
inp[1] = np.clip(inp[1] * (np.random.random() * (0.4) + 0.6), 0, 1)
inp[2] = np.clip(inp[2] * (np.random.random() * (0.4) + 0.6), 0, 1)

RuntimeError: The size of tensor a (27) must match the size of tensor b (26) at non-singleton dimension 3

I put the pretrained model and a test picture in /src/, and run
python demo.py -demo test_1.png
The std error is

/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/matplotlib/init.py:962: UserWarning: Duplicate key in file "/home/ubuntu/.config/matplotlib/matplotlibrc", line #2
(fname, cnt))
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/matplotlib/init.py:962: UserWarning: Duplicate key in file "/home/ubuntu/.config/matplotlib/matplotlibrc", line #3
(fname, cnt))
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.container.ModuleList' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.upsampling.Upsample' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/serialization.py:325: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "demo.py", line 31, in
main()
File "demo.py", line 20, in main
output = model(input_var)
File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/pytorch-pose-hg-3d/src/models/hg_3d.py", line 112, in forward
hg = self.hourglassi
File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/pytorch-pose-hg-3d/src/models/hg_3d.py", line 46, in forward
low2 = self.low2(low1)
File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/pytorch-pose-hg-3d/src/models/hg_3d.py", line 46, in forward
low2 = self.low2(low1)
File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/pytorch-pose-hg-3d/src/models/hg_3d.py", line 46, in forward
low2 = self.low2(low1)
File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/home/ubuntu/pytorch-pose-hg-3d/src/models/hg_3d.py", line 57, in forward
return up1 + up2
RuntimeError: The size of tensor a (27) must match the size of tensor b (26) at non-singleton dimension 3

Terrible result during training

Hi Xingyi,
When I was training in stage2&3, I found that the accuracy and MPJPE is so terrible. I noticed accuracy drop from 0.83 to 0.02 in the first epoch of stage1! Is that possible reason for such case?

Here is the log. pytorch-gpu version=0.3.1
image

Error when running demo

There was an error when trying to run the demo with python3 but it got solved when I used python2
This was the error :
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 875: ordinal not in range(128)

demo error

Hi,
Thank you for your work.
I am facing a error while running the demo as shown below. In addition, it took around 5mins to produce the error output.

image

I have install all the required packages.

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.