PyTorch implementation of the Pose Residual Network (PRN)

Overview

Pose Residual Network

This repository contains a PyTorch implementation of the Pose Residual Network (PRN) presented in our ECCV 2018 paper:

Muhammed Kocabas, Salih Karagoz, Emre Akbas. MultiPoseNet: Fast Multi-Person Pose Estimation using Pose Residual Network. In ECCV, 2018. arxiv

PRN is described in Section 3.2 of the paper.

Getting Started

We have tested our method on Coco Dataset

Prerequisites

python
pytorch
numpy
tqdm
pycocotools
progress
scikit-image

Installing

  1. Clone this repository git clone https://github.com/salihkaragoz/pose-residual-network-pytorch.git

  2. Install Pytorch

  3. pip install -r src/requirements.txt

  4. To download COCO dataset train2017 and val2017 annotations run: bash data/coco.sh. (data size: ~240Mb)

Training

python train.py

For more options look at opt.py

Testing

  1. Download pre-train model

  2. python test.py --test_cp=PathToPreTrainModel/PRN.pth.tar

Results

Results on COCO val2017 Ground Truth data.

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets= 20 ] = 0.892
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets= 20 ] = 0.978
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets= 20 ] = 0.921
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.883
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.912
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 20 ] = 0.917
 Average Recall     (AR) @[ IoU=0.50      | area=   all | maxDets= 20 ] = 0.982
 Average Recall     (AR) @[ IoU=0.75      | area=   all | maxDets= 20 ] = 0.937
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.902
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.944

License

Citation

If you find this code useful for your research, please consider citing our paper:

@Inproceedings{kocabas18prn,
  Title          = {Multi{P}ose{N}et: Fast Multi-Person Pose Estimation using Pose Residual Network},
  Author         = {Kocabas, Muhammed and Karagoz, Salih and Akbas, Emre},
  Booktitle      = {European Conference on Computer Vision (ECCV)},
  Year           = {2018}
}
Comments
  • This repo is a scam

    This repo is a scam

    Don't waste your time dealing with the code, cause I did it for you. I've made an input-label collage. As you can see the network learns to blur the (slightly blurred and filtered) labels passed to it as input. io

    opened by VladislavZavadskyy 4
  • Confuse of input and label

    Confuse of input and label

    The dataloader of coco dataset shows the details of the work how to exploit in network training. But I check the dataloader function, the weight and output actually is same "dataloader.py---- line 43-64 and line 75--95", the input is the weighs variable from gendata function, why the input is coming from the known keypoints position information rather than the true image data? It is definitely different from what u said in the paper. It means that u use the known label to predict the known label? Does it make sense? If I have some misunderstanding about the code, please let me know.

    for j in range(17): if kpv[j] > 0: x0 = int((kpx[j] - x) * x_scale) y0 = int((kpy[j] - y) * y_scale)

                if x0 >= self.bbox_width and y0 >= self.bbox_height:
                    output[self.bbox_height - 1, self.bbox_width - 1, j] = 1
                elif x0 >= self.bbox_width:
                    output[y0, self.bbox_width - 1, j] = 1
                elif y0 >= self.bbox_height:
                    try:
                        output[self.bbox_height - 1, x0, j] = 1
                    except:
                        output[self.bbox_height - 1, 0, j] = 1
                elif x0 < 0 and y0 < 0:
                    output[0, 0, j] = 1
                elif x0 < 0:
                    output[y0, 0, j] = 1
                elif y0 < 0:
                    output[0, x0, j] = 1
                else:
                    output[y0, x0, j] = 1
    
        img_id = ann_data['image_id']
        img_data = coco.loadImgs(img_id)[0]
        ann_data = coco.loadAnns(coco.getAnnIds(img_data['id']))
    
        for ann in ann_data:
            kpx = ann['keypoints'][0::3]
            kpy = ann['keypoints'][1::3]
            kpv = ann['keypoints'][2::3]
    
            for j in range(17):
                if kpv[j] > 0:
                    if (kpx[j] > bbox[0] - bbox[2] * self.threshold and kpx[j] < bbox[0] + bbox[2] * (1 + self.threshold)):
                        if (kpy[j] > bbox[1] - bbox[3] * self.threshold and kpy[j] < bbox[1] + bbox[3] * (1 + self.threshold)):
                            x0 = int((kpx[j] - x) * x_scale)
                            y0 = int((kpy[j] - y) * y_scale)
    
                            if x0 >= self.bbox_width and y0 >= self.bbox_height:
                                weights[self.bbox_height - 1, self.bbox_width - 1, j] = 1
                            elif x0 >= self.bbox_width:
                                weights[y0, self.bbox_width - 1, j] = 1
                            elif y0 >= self.bbox_height:
                                weights[self.bbox_height - 1, x0, j] = 1
                            elif x0 < 0 and y0 < 0:
                                weights[0, 0, j] = 1
                            elif x0 < 0:
                                weights[y0, 0, j] = 1
                            elif y0 < 0:
                                weights[0, x0, j] = 1
                            else:
                                weights[y0, x0, j] = 1
    
        for t in range(17):
            weights[:, :, t] = gaussian(weights[:, :, t])
        output = gaussian(output, sigma=2, mode='constant', multichannel=True)
        # weights = gaussian_multi_input_mp(weights)
        # output = gaussian_multi_output(output)
        return weights, output
    
    good first issue 
    opened by xiaoxiaoSummer 4
  • Find some weird code in eval.py

    Find some weird code in eval.py

    Hi, thanks for your work. When I looking your code about this repository , i find somewhere is weird in eval.py. When to get predicated bbox_keypoints, you used the true keypoints to assign the bbox_keypoints. The code in eval.py is about line 200 and line 205.

    The peaks is true keypoints coordinate, is it right? It seems that used the true coordinate to assign the predicated bbox_keypoints. Actually i think the line 209~220 in eval.py is the right way to get real predicated bbox_keypoints.

    May be you can give me some advice about this, thanks.

    opened by murdockhou 3
  • pretrain model is different from the defined model [Solved]

    pretrain model is different from the defined model [Solved]

    Hi, I download the code and pre-trained model. Then I just run test: RuntimeError: Error(s) in loading state_dict for PRN: Missing key(s) in state_dict: "bneck.weight", "bneck.bias". Unexpected key(s) in state_dict: "dens3.weight", "dens3.bias".

    It looks like the model definition is different from the pre-trainined model.

    bug 
    opened by xjsxujingsong 3
  • Corrupted tar archive

    Corrupted tar archive

    Hello, Although the name of the issue is self-explanatory, I'll add a few details here :

    • The archive is 806MB, that seems a bit large, especially when the pth file of a trained retina net is less than 200MB
    • The file can't be opened, which is a shame, I'd love to replicate your results :)

    I hope you will be able to help, have a nice day !

    opened by AlexLacour 2
  • How to build a entire solution with video or image as input?

    How to build a entire solution with video or image as input?

    @salihkaragoz Thanks for you excellent works .I read the the code and found it is a key part of the solution your papers mentioned . do you have a entire solution with video or image as input? thanks!

    opened by lianuo 2
  • Keypoint Estimation Subnet

    Keypoint Estimation Subnet

    Does this code contain the implementation of Keypoint Estimation Subnet? And how to add a loss at each level of K features in Keypoint Estimation Subnet? Thanks!

    question 
    opened by 994374821 2
  • Doubt with Our keypoints + Our bboox?

    Doubt with Our keypoints + Our bboox?

    Hi@salihkaragoz Thank you for your novel work, i have some doubt when we do real test.

    PRN is trained on both GT, when we test with our predicted keypoints and box, do we need to train it again, or just use the same model in this reposity? If we need to train it with Our keypoints + Our bboox, how can we prepare the input and target?

    enhancement 
    opened by abeardear 2
  • Pre-Trained model tar archive corrupted

    Pre-Trained model tar archive corrupted

    @salihkaragoz Provided pre trained model tar archive to reproduce test results is corrupted, https://drive.google.com/file/d/1OhdMllLGnpRAk6Wexw8LzXF_EHiolVj1/view?usp=sharing

    Can you please provide a new one?

    Thank you in advance.

    opened by nebojsaandjelkovic 1
  • Softmax across all keypoints?

    Softmax across all keypoints?

    class Flatten(nn.Module):
        def forward(self, input):
            return input.view(input.size(0), -1)
    
    class PRN(nn.Module):
        def __init__(self,node_count,coeff):
            ...
            self.softmax   = nn.Softmax(dim=1)
    
        def forward(self, x):
            res = self.flatten(x)
            ...
            out = self.add(out,res)  # [N,H*W*C]
            out = self.softmax(out)
            out = out.view(out.size()[0],self.height, self.width, 17)
    
            return out
    
    
    opened by DouYishun 1
  • Hey @VladislavZavadskyy,

    Hey @VladislavZavadskyy,

    Could you clearly describe your problem instead of making a groundless judgment? This repo isn't a full pipeline of the things that we introduced in our recent paper, just a demo of the main contribution to help people to understand the idea. If you can state your issue in a concise way, maybe we can guide you to correct resources.

    Thanks,

    Originally posted by @mkocabas in https://github.com/salihkaragoz/pose-residual-network-pytorch/issues/14#issuecomment-422727642

    Yes we would like you to direct us exactly the training methodology your preprocessing pipeline and ur hyper paramater tuning strategy. Or you could just release ur pretrained model which you were promising from long time.

    opened by pavanteja295 1
  • Reproducing results reported by paper

    Reproducing results reported by paper

    Given that the full network & training flow is not released by the authors, did anyone actually fully succeed in reproducing the results written in the paper (both the accuracy & speed of 23 FPS)? Either DL framework is ok. Thank you.

    opened by arvkr 0
  • Zero division by bbox[3]

    Zero division by bbox[3]

    Hi, I got a zero division error during the training, I'm wondering when a bbox[3] has a zero value? Please help to solve this issue, thanks a lot!


    index created! 14%|██████████████████▊ | 9072/64115 [11:40<52:52, 17.35it/s]Traceback (most recent call last): File "train.py", line 81, in main(option) File "train.py", line 68, in main Evaluation(model, opt) File "~/pose_residual_network.pytorch/src/eval.py", line 221, in Evaluation y_scale = float(h) / math.ceil(b[3]) ZeroDivisionError: float division by zero 14%|██████████████████▌ | 9072/64115 [11:40<1:10:52, 12.95it/s]

    opened by shi27feng 0
Owner
Salih Karagoz
Salih Karagoz
Code for "Human Pose Regression with Residual Log-likelihood Estimation", ICCV 2021 Oral

Human Pose Regression with Residual Log-likelihood Estimation [Paper] [arXiv] [Project Page] Human Pose Regression with Residual Log-likelihood Estima

JeffLi 347 Dec 24, 2022
Pytorch implementation of Deep Recursive Residual Network for Super Resolution (DRRN)

DRRN-pytorch This is an unofficial implementation of "Deep Recursive Residual Network for Super Resolution (DRRN)", CVPR 2017 in Pytorch. [Paper] You

yun_yang 192 Dec 12, 2022
PyTorch implementation of Wide Residual Networks with 1-bit weights by McDonnell (ICLR 2018)

1-bit Wide ResNet PyTorch implementation of training 1-bit Wide ResNets from this paper: Training wide residual networks for deployment using a single

Sergey Zagoruyko 122 Dec 7, 2022
A PyTorch implementation for PyramidNets (Deep Pyramidal Residual Networks)

A PyTorch implementation for PyramidNets (Deep Pyramidal Residual Networks) This repository contains a PyTorch implementation for the paper: Deep Pyra

Greg Dongyoon Han 262 Jan 3, 2023
Graph Regularized Residual Subspace Clustering Network for hyperspectral image clustering

Graph Regularized Residual Subspace Clustering Network for hyperspectral image clustering

Yaoming Cai 5 Jul 18, 2022
PyTorch code for our ECCV 2018 paper "Image Super-Resolution Using Very Deep Residual Channel Attention Networks"

PyTorch code for our ECCV 2018 paper "Image Super-Resolution Using Very Deep Residual Channel Attention Networks"

Yulun Zhang 1.2k Dec 26, 2022
PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)

About PyTorch 1.2.0 Now the master branch supports PyTorch 1.2.0 by default. Due to the serious version problem (especially torch.utils.data.dataloade

Sanghyun Son 2.1k Jan 1, 2023
Wide Residual Networks (WideResNets) in PyTorch

Wide Residual Networks (WideResNets) in PyTorch WideResNets for CIFAR10/100 implemented in PyTorch. This implementation requires less GPU memory than

Jason Kuen 296 Dec 27, 2022
Simple Pose: Rethinking and Improving a Bottom-up Approach for Multi-Person Pose Estimation

SimplePose Code and pre-trained models for our paper, “Simple Pose: Rethinking and Improving a Bottom-up Approach for Multi-Person Pose Estimation”, a

Jia Li 256 Dec 24, 2022
《Unsupervised 3D Human Pose Representation with Viewpoint and Pose Disentanglement》(ECCV 2020) GitHub: [fig9]

Unsupervised 3D Human Pose Representation [Paper] The implementation of our paper Unsupervised 3D Human Pose Representation with Viewpoint and Pose Di

null 42 Nov 24, 2022
Repository for the paper "PoseAug: A Differentiable Pose Augmentation Framework for 3D Human Pose Estimation", CVPR 2021.

PoseAug: A Differentiable Pose Augmentation Framework for 3D Human Pose Estimation Code repository for the paper: PoseAug: A Differentiable Pose Augme

Pyjcsx 328 Dec 17, 2022
This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation

SO-Pose This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation This paper is basically an

shangbuhuan 52 Nov 25, 2022
Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Ibai Gorordo 99 Dec 31, 2022
Official Implementation for "ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement" https://arxiv.org/abs/2104.02699

ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement Recently, the power of unconditional image synthesis has significantly advanced th

null 967 Jan 4, 2023
Torch implementation of "Enhanced Deep Residual Networks for Single Image Super-Resolution"

NTIRE2017 Super-resolution Challenge: SNU_CVLab Introduction This is our project repository for CVPR 2017 Workshop (2nd NTIRE). We, Team SNU_CVLab, (B

Bee Lim 625 Dec 30, 2022
Official code of ICCV2021 paper "Residual Attention: A Simple but Effective Method for Multi-Label Recognition"

CSRA This is the official code of ICCV 2021 paper: Residual Attention: A Simple But Effective Method for Multi-Label Recoginition Demo, Train and Vali

null 163 Dec 22, 2022
harmonic-percussive-residual separation algorithm wrapped as a VST3 plugin (iPlug2)

Harmonic-percussive-residual separation plug-in This work is a study on the plausibility of a sines-transients-noise decomposition inspired algorithm

Derp Learning 9 Sep 1, 2022
RMNet: Equivalently Removing Residual Connection from Networks

RM Operation can equivalently convert ResNet to VGG, which is better for pruning; and can help RepVGG perform better when the depth is large.

null 8 Nov 4, 2021
Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising

Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising

Kai Zhang 1.2k Dec 29, 2022