GithubHelp home page GithubHelp logo

kevinlin311tw / cdcl-human-part-segmentation Goto Github PK

View Code? Open in Web Editor NEW
270.0 12.0 42.0 5.81 MB

Repository for Paper: Cross-Domain Complementary Learning Using Pose for Multi-Person Part Segmentation (TCSVT20)

Home Page: https://arxiv.org/abs/1907.05193

License: Other

Python 98.50% Dockerfile 1.07% Shell 0.43%
human-parsing multi-human-parsing synthetic-data multi-person domain-adaptation keras human-pose-estimation human-understanding human-part-segmentation

cdcl-human-part-segmentation's Introduction

CDCL

PWC

This is the code repository for the paper:
Cross-Domain Complementary Learning Using Pose for Multi-Person Part Segmentation
Kevin Lin, Lijuan Wang, Kun Luo, Yinpeng Chen, Zicheng Liu, Ming-Ting Sun

[PDF] [arXiv] [Demo Video] [ICCV2019 Demo Poster]

We address the problem of learning multi-person part segmentation without human labeling. Our proposed complementary learning technique learns a neural network model for multi-person part segmentation using a synthetic dataset and a real dataset. We observe that real and synthetic humans share a common skeleton structure. During learning, the proposed model extracts human skeletons which effectively bridges the synthetic and real domains. Without using human-annotated part segmentation labels, the resultant model works well on real world images.

Citing paper

If you find CDCL useful for your research, please consider citing:

@article{lin2020cross,
  Title    = {Cross-Domain Complementary Learning Using Pose for Multi-Person Part Segmentation},
  Author   = {Lin, Kevin and Wang, Lijuan and Luo, Kun and Chen, Yinpeng and Liu, Zicheng and Sun, Ming-Ting},
  Journal  = {IEEE Transactions on Circuits and Systems for Video Technology},
  Year     = {2020}
}

    or

@article{lin2019cross,
  Title    = {Cross-Domain Complementary Learning with Synthetic Data for Multi-Person Part Segmentation},
  Author   = {Lin, Kevin and Wang, Lijuan and Luo, Kun and Chen, Yinpeng and Liu, Zicheng and Sun, Ming-Ting},
  Journal  = {arXiv preprint arXiv:1907.05193},
  Year     = {2019}
}

Installation instructions

Our codebase is developed based on Ubuntu 16.04 LTS, CUDA 9.0, CUDNN 7.0, Tensorflow 1.12.0, Keras 2.1.1.

Anaconda

We suggest creating a new conda environment for setting up the relevant dependencies. After installing Anaconda on your machine, please run the following command:

$ conda env create -f cdcl_environment.yaml

After creating the environment, you just need to activate the environment and continue running the demo code.

$ conda activate cdcl

Docker

Alternatively, we provide the Dockerfile which can be used to build a docker image with all dependencies pre-installed. You can find the Dockerfile in the folder docker. After installing Docker and Nvidia-Docker2, please go to the folder docker, and run the following command to build the docker image:

$ sudo docker build -t cdcl:v1 .

After this, you can test your docker image on your machine

$ sudo docker run --runtime=nvidia -v PathA:PathB -it cdcl:v1 bash

It is important to note that this command will mount a local folder in the docker container. PathA is the folder path of this repo in your machine. PathB is the target folder path in the container.

Other install solution

If Anaconda and Docker do not work well on you machine, we list the required packages as below for you to manually install the dependencies.

$ sudo apt-get -y update
$ sudo apt-get -y install libboost-all-dev libhdf5-serial-dev libzmq3-dev libopencv-dev python-opencv git vim
$ sudo pip install Cython scikit-image keras==2.1.1 configobj IPython
$ sudo apt-get -y install python-tk python3-pip python3-dev python3-tk cuda-toolkit-9-0
$ sudo pip3 install tensorflow-gpu==1.12.0
$ sudo pip3 install keras==2.1.1 Cython scikit-image pandas zmq h5py opencv-python IPython configobj cupy-cuda90

Fetch data

To run our code, you need to also fetch some additional files. Please run the following command:

$ bash fetch_data.sh

This script will fetch two pretrained neural network models. In this demo script, we provide a pretrained model, which is firstly trained on COCO2014 and our multi-person synthetic data, and then fine-tuned on PASCAL-Person-Part dataset.

This pre-trained model predcits 6 body parts in the images, and achieves 72.82% mIOU on PASCAL-Person-Part dataset. We denote this model as CDCL+PASCAL in our paper.

We also provide a pre-trained model, which predicts 15 body parts in the image. This model is trained without real data labels. We denote this model as CDCL in our paper.

Download files manually

If the script does not work well on your machine, you could manually download the pre-trained weights through the following links. Please unzip the downloaded files, and put the pre-trained weights in the folder weights

Model weights for 6 body parts: Dropbox GoogleDrive

Model weights for 15 body parts: Dropbox GoogleDrive

Run the inference code

This demo runs multi-person part segmentation on the test images. In order to run the inference code, you need to put your testing images in the folder input. Our inference code will iterate all images in the folder, and generate the results in the folder output.

We provide 2 different ways to use our inference code. Here are the example usages:

For single-scale inference, please run the following command

$ python3 inference_7parts.py --scale=1

You may also like to run the following command for multi-scale inference for more accurate results

$ python3 inference_7parts.py --scale=1 --scale=0.5 --scale=0.75

For 15 parts prediction, please run the following command

$ python3 inference_15parts.py --scale=1

Similarly, you can run the following command for multi-scale inference for more accurate results

$ python3 inference_15parts.py --scale=1 --scale=0.5 --scale=0.75

Training

The traing code is developed based on our previous repo keras-openpose-reproduce

The proposed training code and the synthetic data will be released after company approval.

Contact

Please feel free to leave suggestions or comments to Kevin Lin ([email protected]), Lijuan Wang ([email protected]), Zicheng Liu ([email protected]), Ming-Ting Sun ([email protected])

cdcl-human-part-segmentation's People

Contributors

kevinlin311tw 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

cdcl-human-part-segmentation's Issues

Weights Link Down

Great work!! The model weights link is down... Could you please update it. Thank you.

Needed to set "allow_growth"

Just documenting this in case anyone else encounters this issue.
Built the provided dockerfile and ran python3 inference_15parts.py --scale=1 --scale=0.5 --scale=0.75

Saw E tensorflow/stream_executor/cuda/cuda_dnn.cc:373] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR (among other errors) when calling model.predict.

Resolved the issue by adding the following to inference_15parts.py

import tensorflow as tf
from keras.backend.tensorflow_backend import set_session

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
set_session(sess)

Inference time

Hi, What is the inference time of the model, On what resolution and on which device has it been tested on? Could you please share these detailes?
Thanks

About the mIOU for CDCL+voc?

I test your provided weight-model_simulated_RGB_mgpu_scaling_append.0024.h5, but i just test the MIOU is 69.53, i am very confused with this, and can you provide your test codes?

Can i save one by one?

2_60634_76331_1133

Like the image

If there are multiple people or overlapping, I want to save each person separately. Is that possible?

Please give me some advice

CDCL+COCO Model Weights

Hi!

Do you have a release for CDCL+COCO? I would love to use and cite your research but without access to the synthetic training data or model weights I am a bit stuck.

Thank you!

training code

Great work!When do you realease training code?

inference error

when i run "python3 inference_15parts.py --scale=1" , error happens like:

Traceback (most recent call last):
File "inference_15parts.py", line 200, in
model = get_testing_model_resnet101()
File "D:\body\body\model_simulated_RGB101.py", line 456, in get_testing_model_resnet101
C1, C2, C3, C4, C5 = ResNet101_graph(img_input, None)
File "D:\body\body\model_simulated_RGB101.py", line 250, in ResNet101_graph
x = conv_block(x, 3, [64, 64, 256], stage=2, block='a', strides=(1, 1))
File "D:\body\body\model_simulated_RGB101.py", line 208, in conv_block
x = BatchNormalization(epsilon=eps, axis=bn_axis,name=bn_name_base + '2a')(x)
File "D:\Python3.6\lib\site-packages\keras\engine\base_layer.py", line 463, in call
self.build(unpack_singleton(input_shapes))
File "D:\Python3.6\lib\site-packages\keras\layers\normalization.py", line 99, in build
str(input_shape) + '.')
ValueError: Axis 1 of input tensor should have a defined dimension but the layer received an input with shape (None, None, None, 64).

Has anyone been in the same situation like this?

Full part model

Amazing work. When do you think the pre-trained models with all parts will be available?

LICENSE

Hi,

thank you for sharing your work.
Could you add a LICENSE file to the repo?

thanks,

Jeremy

Synthetic data

Hi,
thanks for sharing the great insight. Taking advantage of synthetic data to promote performance on real data is realy thoughtful!
Many readers are waiting for the scripts to generate the sysnthetic data and also the training code. Please kindly share it so that the community can benefit from your cutting-edge works. Thank you.

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.