Giter Club home page Giter Club logo

densepose's Introduction

DensePose:

Dense Human Pose Estimation In The Wild

Rıza Alp Güler, Natalia Neverova, Iasonas Kokkinos

[densepose.org] [arXiv] [BibTeX]

Dense human pose estimation aims at mapping all human pixels of an RGB image to the 3D surface of the human body. DensePose-RCNN is implemented in the Detectron framework and is powered by Caffe2.

In this repository, we provide the code to train and evaluate DensePose-RCNN. We also provide notebooks to visualize the collected DensePose-COCO dataset and show the correspondences to the SMPL model.

Important Note

!!! This project is no longer supported !!!

DensePose is now part of Detectron2 (https://github.com/facebookresearch/detectron2/tree/master/projects/DensePose). There you can find the most up to date architectures / models. If you think some feature is missing from there, please post an issue in Detectron2 DensePose.

Installation

Please find installation instructions for Caffe2 and DensePose in INSTALL.md, a document based on the Detectron installation instructions.

Inference-Training-Testing

After installation, please see GETTING_STARTED.md for examples of inference and training and testing.

Notebooks

Visualization of DensePose-COCO annotations:

See notebooks/DensePose-COCO-Visualize.ipynb to visualize the DensePose-COCO annotations on the images:


DensePose-COCO in 3D:

See notebooks/DensePose-COCO-on-SMPL.ipynb to localize the DensePose-COCO annotations on the 3D template (SMPL) model:


Visualize DensePose-RCNN Results:

See notebooks/DensePose-RCNN-Visualize-Results.ipynb to visualize the inferred DensePose-RCNN Results.


DensePose-RCNN Texture Transfer:

See notebooks/DensePose-RCNN-Texture-Transfer.ipynb to localize the DensePose-COCO annotations on the 3D template (SMPL) model:

License

This source code is licensed under the license found in the LICENSE file in the root directory of this source tree.

Citing DensePose

If you use Densepose, please use the following BibTeX entry.

  @InProceedings{Guler2018DensePose,
  title={DensePose: Dense Human Pose Estimation In The Wild},
  author={R\{i}za Alp G\"uler, Natalia Neverova, Iasonas Kokkinos},
  journal={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2018}
  }

densepose's People

Contributors

adonese avatar agrimgupta92 avatar ashwinb avatar dimitrijer avatar egornemchinov avatar gadcam avatar immortalturtle avatar ir413 avatar juggernaut93 avatar katotetsuro avatar newstzpz avatar nneverova avatar nvrv avatar ralpguler avatar rbgirshick avatar roytseng-tw avatar rversaw avatar shenyunhang avatar superirabbit avatar vkhalidov avatar yangqing 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  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

densepose's Issues

KeyError: u'Non-existent config key: BODY_UV_RCNN'

Hello,
The tests in the install section are passing OK and i have downloaded the DenseposeData but when i try to do inference as proposed in the getting started:

python2 tools/infer_simple.py \ --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml \ --output-dir DensePoseData/infer_out/ \ --image-ext jpg \ --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl \ DensePoseData/demo_data/demo_im.jpg

i got the following error:
Traceback (most recent call last): File "tools/infer_simple.py", line 140, in <module> main(args) File "tools/infer_simple.py", line 87, in main merge_cfg_from_file(args.cfg) File "/home/user/densepose/detectron/detectron/core/config.py", line 1127, in merge_cfg_from_file _merge_a_into_b(yaml_cfg, __C) File "/home/user/densepose/detectron/detectron/core/config.py", line 1177, in _merge_a_into_b raise KeyError('Non-existent config key: {}'.format(full_key)) KeyError: u'Non-existent config key: BODY_UV_RCNN'
Thank you in advance.

'ascii' codec can't decode byte 0x81 in position 1224: ordinal not in range(128)

Following the DensePose-COCO dataset and SMPL model notebook and after I downloaded and extracted the file in the correct location I get this error.

`---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
in ()
6 # Now read the smpl model.
7 with open('../DensePoseData/basicmodel_m_lbs_10_207_0_v1.0.0.pkl', 'rb') as f:
----> 8 data = pickle.load(f)
9 Vertices = data['v_template'] ## Loaded vertices of size (6890, 3)
10 X,Y,Z = [Vertices[:,0], Vertices[:,1],Vertices[:,2]]

UnicodeDecodeError: 'ascii' codec can't decode byte 0x81 in position 1224: ordinal not in range(128)`

load "demo_dp_single_ann.pkl" error

pkl_file = open('DensePoseData/demo_data/demo_dp_single_ann.pkl', 'rb')
Demo = pickle.load(pkl_file)

error:
dispatch [key] (self)
KeyError: '\n'

Infer to a video

Hi,
Thank you for your great work. My name is Albert Christianto.
I'm a little bit curious. Do you have any example code to infer a video ?
Thanks a lot.
best regards,
Albert

KeyError: u'rois'

Notice, this error only happened when I use small model DensePose_ResNet50_FPN_s1x.yaml, other model like DensePose_ResNet101_FPN_s1x-e2e.pkl, DensePose_ResNet101_FPN_32x8d_s1x-e2e.yaml is fine.

when I ran script

python tools/infer_simple.py \
    --cfg configs/DensePose_ResNet50_FPN_s1x.yaml \
    --output-dir /home/wangbin/Desktop/densepose/star_small_model \
    --image-ext jpg \
    --wts /home/wangbin/models/densepose/DensePose_ResNet50_FPN_s1x.pkl \
    /home/wangbin/Downloads/imageAssist/star

errors happens as follow:

INFO infer_simple.py: 103: Processing /home/wangbin/Downloads/imageAssist/star/ia_10008.jpg -> /home/wangbin/Desktop/densepose/star_small_model/ia_10008.jpg.pdf
Traceback (most recent call last):
  File "tools/infer_simple.py", line 140, in <module>
    main(args)
  File "tools/infer_simple.py", line 109, in main
    model, im, None, timers=timers
  File "/home/wangbin/github/densepose/detectron/core/test.py", line 58, in im_detect_all
    model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals
  File "/home/wangbin/github/densepose/detectron/core/test.py", line 145, in im_detect_bbox
    hashes = np.round(inputs['rois'] * cfg.DEDUP_BOXES).dot(v)
KeyError: u'rois'

os: ubuntu16.04
g++: 5.4
cuda8.0+cudnn7.0.5
caffe2 master branch newly complied

Windows compatibility?

Does anyone know if this works on windows? Or how much work would be involved in getting it working on windows? Seems Caffe2 is now, at least, experimentally working on windows.

Sam

Demo_dp_single_ann.pkl

demo_dp_single_ann.pkl file is missing from the demo_data directory
Could you guide how to generate this output pkl file ?

Can I estimate 3D pose using densepose?

Densepose can match each pixel to human body.
So, I wonder if human body also can be matched to the original image in inverse.
Can I do that with densepose?

It is too hard to install.

Hello, I just find the good work in a news and I try to install, but just want to say it is a little complicated to install. Why don't you make the life easier,making it like:
-pip install DensePose.

:) hahaha, anyway, good work.

Wrong path in densepose_methods.py

In densepose_methods.py, we search for UV_data/ instead of uv_data.

File "/densepose/detectron/utils/densepose_methods.py", line 18, in __init__
ALP_UV = loadmat( os.path.join(os.path.dirname(__file__), '../../DensePoseData/UV_data/UV_Processed.mat')  )
...
IOError: [Errno 2] No such file or directory: '/densepose/detectron/utils/../../DensePoseData/UV_data/UV_Processed.mat'

While in the install script DensePose/DensePoseData/get_densepose_uv.sh:

mkdir uv_data
...

I made a correction to densepose_methods.py but not sure if UV_data is used elsewhere (I think not), might be safer to update the install script instead.

UV_Processed.mat Missing

Hello,

I was trying to execute the DensePose algorithm and I got an error, could kindly look at it.

I ran this, on docker after installation.

sudo nvidia-docker run --rm -it densepose:c2-cuda9-cudnn7 python2 tools/infer_simple.py --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml --output-dir DensePoseData/infer_out/ --image-ext jpg --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl DensePoseData/demo_data/demo_im.jpg

And I am getting the following error, Also I don't see the UV_Processed.mat in the folder.

Traceback (most recent call last): File "tools/infer_simple.py", line 34, in <module> import detectron.core.test_engine as infer_engine File "/densepose/detectron/core/test_engine.py", line 27, in <module> from detectron.core.rpn_generator import generate_rpn_on_dataset File "/densepose/detectron/core/rpn_generator.py", line 36, in <module> from detectron.modeling import model_builder File "/densepose/detectron/modeling/model_builder.py", line 38, in <module> from detectron.modeling.detector import DetectionModelHelper File "/densepose/detectron/modeling/detector.py", line 25, in <module> from detectron.ops.collect_and_distribute_fpn_rpn_proposals \ File "/densepose/detectron/ops/collect_and_distribute_fpn_rpn_proposals.py", line 19, in <module> import detectron.roi_data.fast_rcnn as fast_rcnn_roi_data File "/densepose/detectron/roi_data/fast_rcnn.py", line 26, in <module> import detectron.roi_data.body_uv_rcnn as body_uv_rcnn_roi_data File "/densepose/detectron/roi_data/body_uv_rcnn.py", line 32, in <module> DP = dp_utils.DensePoseMethods() File "/densepose/detectron/utils/densepose_methods.py", line 18, in __init__ ALP_UV = loadmat( os.path.join(os.path.dirname(__file__), '../../DensePoseData/UV_data/UV_Processed.mat') ) File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 135, in loadmat MR = mat_reader_factory(file_name, appendmat, **kwargs) File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 58, in mat_reader_factory byte_stream = _open_file(file_name, appendmat) File "/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 23, in _open_file return open(file_like, 'rb') IOError: [Errno 2] No such file or directory: '/densepose/detectron/utils/../../DensePoseData/UV_data/UV_Processed.mat'

Thank you in advance! It's a very interesting project

Docker build failed via DockerFile

Problem:
Docker build failed.

Environment:
Ubuntu 16.04.4 LTS
CUDA Version 9.1.85

Command:
docker build -t densepose .

Error message:
Could not find a package configuration file provided by "Caffe2" with any
of the following names:

Caffe2Config.cmake
caffe2-config.cmake

The full output message:
Sending build context to Docker daemon 2.56kB
Step 1/13 : FROM caffe2/caffe2:snapshot-py2-cuda9.0-cudnn7-ubuntu16.04
---> 9ae3e8ea7508
Step 2/13 : RUN mv /usr/local/caffe2 /usr/local/caffe2_build
---> Running in 0f809c87c8fa
---> d59a5a217608
Removing intermediate container 0f809c87c8fa
Step 3/13 : ENV Caffe2_DIR /usr/local/caffe2_build
---> Running in 8a762212f440
---> 1d0311da1ccb
Removing intermediate container 8a762212f440
Step 4/13 : ENV PYTHONPATH /usr/local/caffe2_build:${PYTHONPATH}
---> Running in 15320724ed47
---> 920f0ea84572
Removing intermediate container 15320724ed47
Step 5/13 : ENV LD_LIBRARY_PATH /usr/local/caffe2_build/lib:${LD_LIBRARY_PATH}
---> Running in 72a65e09d833
---> 95ad88f23908
Removing intermediate container 72a65e09d833
Step 6/13 : RUN git clone https://github.com/facebookresearch/densepose /densepose
---> Running in cce211ddd65b
Cloning into '/densepose'...
---> bb915b4e2585
Removing intermediate container cce211ddd65b
Step 7/13 : RUN pip install -r /densepose/requirements.txt
---> Running in 325a54ac495a
Requirement already satisfied: numpy>=1.13 in /usr/local/lib/python2.7/dist-packages (from -r /densepose/requirements.txt (line 1))
Collecting pyyaml>=3.12 (from -r /densepose/requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz (253kB)
Requirement already satisfied: matplotlib in /usr/local/lib/python2.7/dist-packages (from -r /densepose/requirements.txt (line 3))
Collecting opencv-python>=3.2 (from -r /densepose/requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/0f/87/46f41c6673106030d835342e65133085c22cb36549a9ab883bb3cd3f00bb/opencv_python-3.4.1.15-cp27-cp27mu-manylinux1_x86_64.whl (24.9MB)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from -r /densepose/requirements.txt (line 5))
Collecting Cython (from -r /densepose/requirements.txt (line 6))
Downloading https://files.pythonhosted.org/packages/f6/23/ef5521e077e9e7ef8e4603e27713ae95fee69e9c19c7cd036b4299c7ced5/Cython-0.28.3-cp27-cp27mu-manylinux1_x86_64.whl (3.3MB)
Collecting mock (from -r /densepose/requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/e6/35/f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/mock-2.0.0-py2.py3-none-any.whl (56kB)
Requirement already satisfied: scipy in /usr/local/lib/python2.7/dist-packages (from -r /densepose/requirements.txt (line 8))
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: six>=1.10 in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: subprocess32 in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: python-dateutil>=2.0 in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: backports.functools-lru-cache in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python2.7/dist-packages (from matplotlib->-r /densepose/requirements.txt (line 3))
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /usr/local/lib/python2.7/dist-packages (from mock->-r /densepose/requirements.txt (line 7))
Collecting pbr>=0.11 (from mock->-r /densepose/requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/b3/5d/c196041ffdf3e34ba206db6d61d1f893a75e1f3435699ade9bd65e089a3d/pbr-4.0.4-py2.py3-none-any.whl (98kB)
Installing collected packages: pyyaml, opencv-python, Cython, pbr, mock
Running setup.py install for pyyaml: started
Running setup.py install for pyyaml: finished with status 'done'
Successfully installed Cython-0.28.3 mock-2.0.0 opencv-python-3.4.1.15 pbr-4.0.4 pyyaml-3.12
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
---> 2545e54753b7
Removing intermediate container 325a54ac495a
Step 8/13 : RUN git clone https://github.com/cocodataset/cocoapi.git /cocoapi
---> Running in 6f1203678852
Cloning into '/cocoapi'...
---> 2ae3c917f75b
Removing intermediate container 6f1203678852
Step 9/13 : WORKDIR /cocoapi/PythonAPI
---> e4618d34f71c
Removing intermediate container 0c472cc1dc66
Step 10/13 : RUN make install
---> Running in 15cacb377651
#install pycocotools to the Python site-packages
python setup.py build_ext install
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/_mask.c
building 'pycocotools._mask' extension
creating build
creating build/common
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/pycocotools
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I../common -I/usr/include/python2.7 -c ../common/maskApi.c -o build/temp.linux-x86_64-2.7/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
../common/maskApi.c: In function 'rleToBbox':
../common/maskApi.c:141:31: warning: 'xp' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(j%2==0) xp=x; else if(xp<x) { ys=0; ye=h-1; }
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I../common -I/usr/include/python2.7 -c pycocotools/_mask.c -o build/temp.linux-x86_64-2.7/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pycocotools
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/../common/maskApi.o build/temp.linux-x86_64-2.7/pycocotools/_mask.o -o build/lib.linux-x86_64-2.7/pycocotools/_mask.so
running install
running bdist_egg
running egg_info
creating pycocotools.egg-info
writing requirements to pycocotools.egg-info/requires.txt
writing pycocotools.egg-info/PKG-INFO
writing top-level names to pycocotools.egg-info/top_level.txt
writing dependency_links to pycocotools.egg-info/dependency_links.txt
writing manifest file 'pycocotools.egg-info/SOURCES.txt'
reading manifest file 'pycocotools.egg-info/SOURCES.txt'
writing manifest file 'pycocotools.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying pycocotools/coco.py -> build/lib.linux-x86_64-2.7/pycocotools
copying pycocotools/init.py -> build/lib.linux-x86_64-2.7/pycocotools
copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-2.7/pycocotools
copying pycocotools/mask.py -> build/lib.linux-x86_64-2.7/pycocotools
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-2.7/pycocotools/coco.py -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-2.7/pycocotools/_mask.so -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-2.7/pycocotools/init.py -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-2.7/pycocotools/cocoeval.py -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-2.7/pycocotools/mask.py -> build/bdist.linux-x86_64/egg/pycocotools
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/coco.py to coco.pyc
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/cocoeval.py to cocoeval.pyc
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/mask.py to mask.pyc
creating stub loader for pycocotools/_mask.so
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/_mask.py to _mask.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pycocotools-2.0-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pycocotools-2.0-py2.7-linux-x86_64.egg
Copying pycocotools-2.0-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
Adding pycocotools 2.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/pycocotools-2.0-py2.7-linux-x86_64.egg
Processing dependencies for pycocotools==2.0
Searching for matplotlib==2.1.1
Best match: matplotlib 2.1.1
Adding matplotlib 2.1.1 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for Cython==0.28.3
Best match: Cython 0.28.3
Adding Cython 0.28.3 to easy-install.pth file
Installing cython script to /usr/local/bin
Installing cygdb script to /usr/local/bin
Installing cythonize script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages
Searching for setuptools==20.7.0
Best match: setuptools 20.7.0
Adding setuptools 20.7.0 to easy-install.pth file
Installing easy_install script to /usr/local/bin

Using /usr/lib/python2.7/dist-packages
Searching for pyparsing==2.2.0
Best match: pyparsing 2.2.0
Adding pyparsing 2.2.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for backports.functools-lru-cache==1.4
Best match: backports.functools-lru-cache 1.4
Adding backports.functools-lru-cache 1.4 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for python-dateutil==2.6.1
Best match: python-dateutil 2.6.1
Adding python-dateutil 2.6.1 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for subprocess32==3.2.7
Best match: subprocess32 3.2.7
Adding subprocess32 3.2.7 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for pytz==2017.3
Best match: pytz 2017.3
Adding pytz 2017.3 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for six==1.11.0
Best match: six 1.11.0
Adding six 1.11.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for cycler==0.10.0
Best match: cycler 0.10.0
Adding cycler 0.10.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for numpy==1.14.0
Best match: numpy 1.14.0
Adding numpy 1.14.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Finished processing dependencies for pycocotools==2.0
rm -rf build
---> fbd6e653fe27
Removing intermediate container 15cacb377651
Step 11/13 : WORKDIR /densepose
---> ce62b38f7bc5
Removing intermediate container 45fa5505cc94
Step 12/13 : RUN make
---> Running in 672116099a04
python2 setup.py develop --user
Compiling detectron/utils/cython_bbox.pyx because it changed.
Compiling detectron/utils/cython_nms.pyx because it changed.
[1/2] Cythonizing detectron/utils/cython_bbox.pyx
[2/2] Cythonizing detectron/utils/cython_nms.pyx
running develop
running egg_info
creating Detectron.egg-info
writing Detectron.egg-info/PKG-INFO
writing top-level names to Detectron.egg-info/top_level.txt
writing dependency_links to Detectron.egg-info/dependency_links.txt
writing manifest file 'Detectron.egg-info/SOURCES.txt'
reading manifest file 'Detectron.egg-info/SOURCES.txt'
writing manifest file 'Detectron.egg-info/SOURCES.txt'
running build_ext
building 'detectron.utils.cython_bbox' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/detectron
creating build/temp.linux-x86_64-2.7/detectron/utils
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c detectron/utils/cython_bbox.c -o build/temp.linux-x86_64-2.7/detectron/utils/cython_bbox.o -Wno-cpp
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/detectron
creating build/lib.linux-x86_64-2.7/detectron/utils
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/detectron/utils/cython_bbox.o -o build/lib.linux-x86_64-2.7/detectron/utils/cython_bbox.so
building 'detectron.utils.cython_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c detectron/utils/cython_nms.c -o build/temp.linux-x86_64-2.7/detectron/utils/cython_nms.o -Wno-cpp
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/detectron/utils/cython_nms.o -o build/lib.linux-x86_64-2.7/detectron/utils/cython_nms.so
copying build/lib.linux-x86_64-2.7/detectron/utils/cython_bbox.so -> detectron/utils
copying build/lib.linux-x86_64-2.7/detectron/utils/cython_nms.so -> detectron/utils
Creating /root/.local/lib/python2.7/site-packages/Detectron.egg-link (link to .)
Adding Detectron 0.0.0 to easy-install.pth file

Installed /densepose
Processing dependencies for Detectron==0.0.0
Finished processing dependencies for Detectron==0.0.0
---> b14b265de7d1
Removing intermediate container 672116099a04
Step 13/13 : RUN make ops
---> Running in 9ed8b75fdef6
mkdir -p build && cd build && cmake .. && make -j6
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (find_package):
By not providing "FindCaffe2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Caffe2", but
CMake did not find one.

Could not find a package configuration file provided by "Caffe2" with any
of the following names:

Caffe2Config.cmake
caffe2-config.cmake

Add the installation prefix of "Caffe2" to CMAKE_PREFIX_PATH or set
"Caffe2_DIR" to a directory containing one of the above files. If "Caffe2"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!
See also "/densepose/build/CMakeFiles/CMakeOutput.log".
make: *** [ops] Error 1
Makefile:13: recipe for target 'ops' failed
The command '/bin/sh -c make ops' returned a non-zero code: 2

Python requirements in Docker installation

After building the provided Dockerfile and retrieving Densepose data, I tried to run inference with the pretrained model as described at the beginning of GETTING_STARTED.md, which raised ImportError twice: for h5py and then memory_profiler. After manually installing them with pip, inference proceeds as expected.

Perhaps these should be added to requirements.txt?

Minimum GPU requirements for Testing/Inference?

Attempted to get this running on a GeForce GTX 760 with 3gbs ram, and... (perhaps unsurprisingly) i'm getting an 'out of memory' error trying to run the simple inference example...

Does anyone know what the minimum memory required might be to test this model?

Example models with keypoint detection?

I'm wondering how I should setup the model in order to get keypoints?
It seems that none of the example files in configs have MODEL.KEYPOINTS_ON = True.
Any suggestions? Are there any pretrained models which also generate keypoints?

Thank you!

Make ops failing with gflags not found

I have been trying to install the DensePose code by following the instructions on the website. I compiled caffe2 from source and it passes both the tests for the import and the gpu tests passes. Detectron also builds and passes the test on the website. But when I try to build the custom operators library with make ops, I get the following error:

mkdir -p build && cd build && cmake .. && make -j12
CMake Error at ~/Experiment/Projects/pytorch/build/Caffe2Config.cmake:14 (include):
  include could not find load file:

    ~/Experiment/Projects/pytorch/build/public/utils.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


CMake Error at ~/Experiment/Projects/pytorch/build/Caffe2Config.cmake:17 (include):
  include could not find load file:

    ~/Experiment/Projects/pytorch/build/public/threads.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


CMake Error at ~/Experiment/Projects/pytorch/build/Caffe2Config.cmake:22 (include):
  include could not find load file:

    ~/Experiment/Projects/pytorch/build/public/gflags.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


CMake Error at ~/Experiment/Projects/pytorch/build/Caffe2Config.cmake:24 (message):
  Your installed Caffe2 version uses gflags but the gflags library cannot be
  found.  Did you accidentally remove it, or have you set the right
  CMAKE_PREFIX_PATH and/or GFLAGS_ROOT_DIR? If you do not have gflags, you
  will need to install gflags and set the library path accordingly.
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
See also "~/Experiment/Projects/DensePose/CMakeFiles/CMakeOutput.log".
Makefile:13: recipe for target 'ops' failed
make: *** [ops] Error 1

I can't figure out how to fix this issue. I have set the GFLAGS_ROOT_DIR to ~/anaconda3/envs/densePose/lib/cmake/gflags, which I picked from the cmake configuration of caffe2 build, thinking that is what the compiler is looking for since it needs the same gflags used to compile caffe2.

I am using a Ubuntu 16.04, with 2x 1080Ti, CUDA 8 and cuDNNv7.

[enforce fail at conv_op_cudnn.cc:555] filter.dim32(1) == C / group_. 8 vs 256 Error from operator:

source git HEAD:bee2a8a96d3d6cfa9344c8dd341b25fba7ef5580
I build Densepose from source,when run:
python2 tools/infer_simple.py --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml --output-dir DensePoseData/infer_out/ --image-ext jpg --wts /path/to/file/DensePose_ResNet101_FPN_32x8d_s1x-e2e.pkl DensePoseData/demo_data/demo_im.jpg

get error:

I0625 17:30:15.627099   563 net_async_base.cc:421] Using specified CPU pool size: 4; NUMA node id: -1
I0625 17:30:15.627120   563 net_async_base.cc:426] Created new CPU pool, size: 4; NUMA node id: -1
E0625 17:30:16.176945   627 net_async_base.cc:349] [enforce fail at conv_op_cudnn.cc:555] filter.dim32(1) == C / group_. 8 vs 256 Error from operator: 
input: "gpu_0/res2_0_branch2a" input: "gpu_0/res2_0_branch2b_w" output: "gpu_0/res2_0_branch2b" name: "" type: "Conv" arg { name: "kernel" i: 3 } arg { name: "exhaustive_search" i: 0 } arg { name: "stride" i: 1 } arg { name: "pad" i: 1 } arg { name: "order" s: "NCHW" } arg { name: "dilation" i: 1 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN",  op Conv
WARNING workspace.py: 185: Original python traceback for operator `7` in network `generalized_rcnn` in exception above (most recent call last):
WARNING workspace.py: 190:   File "/usr/local/lib/python2.7/dist-packages/caffe2/python/helpers/conv.py", line 139, in _ConvBase
Traceback (most recent call last):
  File "tools/infer_simple.py", line 140, in <module>
    main(args)
  File "tools/infer_simple.py", line 109, in main
    model, im, None, timers=timers
  File "/home/alex/DensePose/detectron/core/test.py", line 58, in im_detect_all
    model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals
  File "/home/alex/DensePose/detectron/core/test.py", line 158, in im_detect_bbox
    workspace.RunNet(model.net.Proto().name)
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 217, in RunNet
    StringifyNetName(name), num_iter, allow_fail,
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 178, in CallWithExceptionIntercept
    return func(*args, **kwargs)
RuntimeError: [enforce fail at conv_op_cudnn.cc:555] filter.dim32(1) == C / group_. 8 vs 256 Error from operator: 
input: "gpu_0/res2_0_branch2a" input: "gpu_0/res2_0_branch2b_w" output: "gpu_0/res2_0_branch2b" name: "" type: "Conv" arg { name: "kernel" i: 3 } arg { name: "exhaustive_search" i: 0 } arg { name: "stride" i: 1 } arg { name: "pad" i: 1 } arg { name: "order" s: "NCHW" } arg { name: "dilation" i: 1 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN"

how to solve this problem?

Strange error when running simple_infer.py, can not figure out what is wrong (CuDNN?)

I am under Ubuntu 16.04, Cuda 8.0 CuDNN 6.0.21; on a GTX 980Ti. I attach my caffe2 cmake summary and my compile log for ref
compile_pytorch.txt
cmake_pytorch.txt

Cannot figure out where is the problem. HELP please!!!

I pass the first caffe2 tests:

  1. python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
    Success
  2. python2 -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
    1

Then I "fail" the relu_op_test.py with a weird message but I have read those errors may just be warnings so not sure.

 python caffe2/python/operator_test/relu_op_test.py
No handlers could be found for logger "caffe2.python.net_drawer"
net_drawer will not run correctly. Please install the correct dependencies.
/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py:75: HypothesisDeprecationWarning: 
The min_satisfying_examples setting has been deprecated and disabled, due to
overlap with the filter_too_much healthcheck and poor interaction with the
max_examples setting.

  verbosity=hypothesis.Verbosity.verbose))
/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py:84: HypothesisDeprecationWarning: 
The min_satisfying_examples setting has been deprecated and disabled, due to
overlap with the filter_too_much healthcheck and poor interaction with the
max_examples setting.

  verbosity=hypothesis.Verbosity.verbose))
/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py:92: HypothesisDeprecationWarning: 
The min_satisfying_examples setting has been deprecated and disabled, due to
overlap with the filter_too_much healthcheck and poor interaction with the
max_examples setting.

  verbosity=hypothesis.Verbosity.verbose))
E0702 22:04:28.531708  3503 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 22:04:28.531721  3503 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 22:04:28.531724  3503 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([0.], dtype=float32), gc=, dc=[, device_type: 1], engine=u'')
{u'X': }
{u'X': device_type: 1
}
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([[[[-0.25521252],
         [-0.25521252],
         [-0.25521252],
         [-0.25521252]],

        [[-0.25521252],
         [-0.25521252],
         [-0.25521252],
         [-0.25521252]],

        [[-0.25521252],
         [-0.25521252],
         [-0.25521252],
         [-0.25521252]]],


       [[[-0.25521252],
         [-0.25521252],
         [ 0.37402993],
         [-0.25521252]],

        [[-0.25521252],
         [-0.25521252],
         [-0.25521252],
         [-0.25521252]],

        [[-0.25521252],
         [-0.25521252],
         [-0.25521252],
         [-0.25521252]]],


       [[[-0.25521252],
         [-0.25521252],
         [ 0.6883273 ],
         [-0.25521252]],

        [[-0.25521252],
         [-0.25521252],
         [-0.25521252],
         [-0.25521252]],

        [[-0.25521252],
         [ 0.86089224],
         [-0.25521252],
         [-0.25521252]]]], dtype=float32), gc=device_type: 1, dc=[, device_type: 1], engine=u'')
{u'X': }
{u'X': device_type: 1
}
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([[-0.793503  , -0.793503  , -0.793503  ],
       [-0.49327314, -0.793503  , -0.793503  ],
       [-0.793503  , -0.793503  , -0.793503  ],
       [-0.29144055, -0.793503  , -0.793503  ],
       [-0.793503  ,  0.07806086, -0.5510364 ]], dtype=float32), gc=device_type: 1, dc=[, device_type: 1], engine=u'CUDNN')
{u'X': }
I0702 22:04:28.761914  3503 operator.cc:169] Engine CUDNN is not available for operator Relu.
{u'X': device_type: 1
}
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/hypothesis/core.py", line 671, in evaluate_test_data
    result = self.execute(data, collect=True)
  File "/usr/local/lib/python2.7/dist-packages/hypothesis/core.py", line 586, in execute
    result = self.test_runner(data, run)
  File "/usr/local/lib/python2.7/dist-packages/hypothesis/executors.py", line 58, in default_new_style_executor
    return function(data)
  File "/usr/local/lib/python2.7/dist-packages/hypothesis/core.py", line 582, in run
    return test(*args, **kwargs)
  File "caffe2/python/operator_test/relu_op_test.py", line 19, in test_relu
    engine=st.sampled_from(["", "CUDNN"]),
  File "/usr/local/lib/python2.7/dist-packages/hypothesis/core.py", line 524, in test
    result = self.test(*args, **kwargs)
  File "caffe2/python/operator_test/relu_op_test.py", line 26, in test_relu
    self.assertDeviceChecks(dc, op, [X], [0])
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/hypothesis_test_util.py", line 350, in assertDeviceChecks
    dc.CheckSimple(op, inputs, outputs_to_check, input_device_options)
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/device_checker.py", line 49, in CheckSimple
    workspace.RunOperatorOnce(op)
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 165, in RunOperatorOnce
    return C.run_operator_once(StringifyProto(operator))
RuntimeError: [enforce fail at context_gpu.h:100] status == CUDNN_STATUS_SUCCESS. 4 vs 0. , Error at: /home/tets/pytorch/caffe2/core/context_gpu.h:100: CUDNN_STATUS_INTERNAL_ERROR Error from operator: 
input: "X" output: "Y" name: "" type: "Relu" device_option { device_type: 1 } engine: "CUDNN"

I compiled denspose with no pb, and passed the detectron checks:

python2 $DENSEPOSE/detectron/tests/test_spatial_narrow_as_op.py
No handlers could be found for logger "caffe2.python.net_drawer"
net_drawer will not run correctly. Please install the correct dependencies.
E0702 22:22:49.913838  3731 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 22:22:49.913887  3731 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 22:22:49.913918  3731 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Found Detectron ops lib: /usr/local/lib/libcaffe2_detectron_ops_gpu.so
...
----------------------------------------------------------------------
Ran 3 tests in 0.932s

OK

 python2 $DENSEPOSE/detectron/tests/test_zero_even_op.py
E0702 22:24:07.535202  3750 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 22:24:07.535217  3750 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 22:24:07.535226  3750 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
............
----------------------------------------------------------------------
Ran 12 tests in 0.136s

OK

But when running the infer_simple.py command, I got the below cryptic error message.

~/densepose$ python2 tools/infer_simple.py     --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml     --output-dir DensePoseData/infer_out/     --image-ext jpg     --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl     DensePoseData/demo_data/20170716_101313.jpg
/home/tets/.local/lib/python2.7/site-packages/h5py/__init__.py:34: 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
Found Detectron ops lib: /usr/local/lib/libcaffe2_detectron_ops_gpu.so
E0702 21:59:20.453374  3391 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 21:59:20.453388  3391 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0702 21:59:20.453392  3391 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
WARNING cnn.py:  25: [====DEPRECATE WARNING====]: you are creating an object from CNNModelHelper class which will be deprecated soon. Please use ModelHelper object with brew module. For more information, please refer to caffe2.ai and python/brew.py, python/brew_test.py for more information.
INFO net.py:  51: Loading weights from: /tmp/detectron-download-cache/DensePose_ResNet101_FPN_s1x-e2e.pkl
I0702 21:59:21.176241  3391 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 0.000106374 secs
I0702 21:59:21.185215  3391 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 8.9347e-05 secs
I0702 21:59:21.186816  3391 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 1.1866e-05 secs
INFO infer_simple.py: 103: Processing DensePoseData/demo_data/20170716_101313.jpg -> DensePoseData/infer_out/20170716_101313.jpg.pdf
I0702 21:59:21.589475  3391 net_async_base.cc:435] Using specified CPU pool size: 4; NUMA node id: -1
I0702 21:59:21.589490  3391 net_async_base.cc:440] Created new CPU pool, size: 4; NUMA node id: -1
E0702 21:59:23.285727  3413 net_async_base.cc:368] [enforce fail at context_gpu.h:100] status == CUDNN_STATUS_SUCCESS. 4 vs 0. , Error at: /home/tets/pytorch/caffe2/core/context_gpu.h:100: CUDNN_STATUS_INTERNAL_ERROR Error from operator: 
input: "gpu_0/data" input: "gpu_0/conv1_w" output: "gpu_0/conv1" name: "" type: "Conv" arg { name: "kernel" i: 7 } arg { name: "exhaustive_search" i: 0 } arg { name: "pad" i: 3 } arg { name: "order" s: "NCHW" } arg { name: "stride" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN",  op Conv
WARNING workspace.py: 185: Original python traceback for operator `0` in network `generalized_rcnn` in exception above (most recent call last):
WARNING workspace.py: 190:   File "tools/infer_simple.py", line 140, in <module>
WARNING workspace.py: 190:   File "tools/infer_simple.py", line 91, in main
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/core/test_engine.py", line 334, in initialize_model_from_cfg
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/model_builder.py", line 119, in create
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/model_builder.py", line 84, in generalized_rcnn
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/model_builder.py", line 233, in build_generic_detection_model
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/optimizer.py", line 46, in build_data_parallel_model
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/model_builder.py", line 165, in _single_gpu_build_func
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/FPN.py", line 55, in add_fpn_ResNet101_conv5_body
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/FPN.py", line 96, in add_fpn_onto_conv_body
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/ResNet.py", line 40, in add_ResNet101_conv5_body
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/ResNet.py", line 90, in add_ResNet_convX_body
WARNING workspace.py: 190:   File "/home/tets/densepose/detectron/modeling/ResNet.py", line 243, in basic_bn_stem
WARNING workspace.py: 190:   File "/usr/local/lib/python2.7/dist-packages/caffe2/python/cnn.py", line 97, in Conv
WARNING workspace.py: 190:   File "/usr/local/lib/python2.7/dist-packages/caffe2/python/brew.py", line 107, in scope_wrapper
WARNING workspace.py: 190:   File "/usr/local/lib/python2.7/dist-packages/caffe2/python/helpers/conv.py", line 186, in conv
WARNING workspace.py: 190:   File "/usr/local/lib/python2.7/dist-packages/caffe2/python/helpers/conv.py", line 139, in _ConvBase
Traceback (most recent call last):
  File "tools/infer_simple.py", line 140, in <module>
    main(args)
  File "tools/infer_simple.py", line 109, in main
    model, im, None, timers=timers
  File "/home/tets/densepose/detectron/core/test.py", line 58, in im_detect_all
    model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals
  File "/home/tets/densepose/detectron/core/test.py", line 158, in im_detect_bbox
    workspace.RunNet(model.net.Proto().name)
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 217, in RunNet
    StringifyNetName(name), num_iter, allow_fail,
  File "/usr/local/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 178, in CallWithExceptionIntercept
    return func(*args, **kwargs)
RuntimeError: [enforce fail at context_gpu.h:100] status == CUDNN_STATUS_SUCCESS. 4 vs 0. , Error at: /home/tets/pytorch/caffe2/core/context_gpu.h:100: CUDNN_STATUS_INTERNAL_ERROR Error from operator: 
input: "gpu_0/data" input: "gpu_0/conv1_w" output: "gpu_0/conv1" name: "" type: "Conv" arg { name: "kernel" i: 7 } arg { name: "exhaustive_search" i: 0 } arg { name: "pad" i: 3 } arg { name: "order" s: "NCHW" } arg { name: "stride" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN"

my NVIDIA setup for ref:

Mon Jul  2 22:20:18 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130                Driver Version: 384.130                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 980 Ti  Off  | 00000000:01:00.0  On |                  N/A |
|  0%   50C    P0    61W / 250W |    243MiB /  6077MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1141      G   /usr/lib/xorg/Xorg                            17MiB |
|    0      1447      G   /usr/lib/xorg/Xorg                           101MiB |
|    0      1917      G   /usr/bin/gnome-shell                          93MiB |
+-----------------------------------------------------------------------------+

Happen to have timing metrics?

Do you happen to have metrics on how many fps this can run inference at with a set resolution/GPU?

edit: nvm found in paper

test failed after train new model using demo

thanks for sharing your works. I try to train the model using the the demo in your GETTING_STARTED.md

python2 tools/train_net.py \
    --cfg configs/DensePose_ResNet50_FPN_single_GPU.yaml \
    OUTPUT_DIR /tmp/detectron-output

How can i test after trainning? I get trouble (KeyError: u'rois'). After checking the code, i found inputs can not get boxes because of the FASTTRCNN:False in yaml file.

it get aborted when running test_spatial_narrow_as_op.py

i run 'python3 detectron/tests/test_spatial_narrow_as_op.py' command after install densePose.
And it get aborted.
The same error happens with test_zero_even_op.py.

The log:

net_drawer will not run correctly. Please install the correct dependencies.
E0706 19:22:05.272351  7774 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0706 19:22:05.272370  7774 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0706 19:22:05.272377  7774 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Found Detectron ops lib: /usr/local/lib/libcaffe2_detectron_ops_gpu.so
*** Aborted at 1530876125 (unix time) try "date -d @1530876125" if you are using GNU date ***
PC: @     0x7f2ff6f2ae10 (unknown)

How to train model with keypoint detection support?

Hello,
I have added
KEYPOINTS_ON: True
to
DensePose_ResNet101_FPN_32x8d_s1x-e2e.yaml

MODEL:
  TYPE: generalized_rcnn
  CONV_BODY: FPN.add_fpn_ResNet101_conv5_body
  NUM_CLASSES: 2
  FASTER_RCNN: True
  BODY_UV_ON: True
  KEYPOINTS_ON: True

and start training,but got error like this:

      'RPN_PRE_NMS_TOP_N': 2000,
          'RPN_STRADDLE_THRESH': 0,
          'SCALES': (640, 672, 704, 736, 768, 800),
          'SNAPSHOT_ITERS': 20000,
          'USE_FLIPPED': True,
          'WEIGHTS': '/home/alex/models/densepose/X-101-32x8d.pkl'},
'USE_NCCL': False,
'VIS': False,
'VIS_TH': 0.9}
INFO train.py: 123: Building model: generalized_rcnn
WARNING cnn.py:  25: [====DEPRECATE WARNING====]: you are creating an object from CNNModelHelper class which will be deprecated soon. Please use ModelHelper object with brew module. For more information, please refer to caffe2.ai and python/brew.py, python/brew_test.py for more information.
Traceback (most recent call last):
 File "tools/train_net.py", line 119, in <module>
   main()
 File "tools/train_net.py", line 101, in main
   checkpoints = detectron.utils.train.train_model()
 File "/home/alex/DensePose/detectron/utils/train.py", line 45, in train_model
   model, weights_file, start_iter, checkpoints, output_dir = create_model()
 File "/home/alex/DensePose/detectron/utils/train.py", line 124, in create_model
   model = model_builder.create(cfg.MODEL.TYPE, train=True)
 File "/home/alex/DensePose/detectron/modeling/model_builder.py", line 119, in create
   return get_func(model_type_func)(model)
 File "/home/alex/DensePose/detectron/modeling/model_builder.py", line 84, in generalized_rcnn
   freeze_conv_body=cfg.TRAIN.FREEZE_CONV_BODY
 File "/home/alex/DensePose/detectron/modeling/model_builder.py", line 233, in build_generic_detection_model
   optim.build_data_parallel_model(model, _single_gpu_build_func)
 File "/home/alex/DensePose/detectron/modeling/optimizer.py", line 32, in build_data_parallel_model
   all_loss_gradients = _build_forward_graph(model, single_gpu_build_func)
 File "/home/alex/DensePose/detectron/modeling/optimizer.py", line 55, in _build_forward_graph
   all_loss_gradients.update(single_gpu_build_func(model))
 File "/home/alex/DensePose/detectron/modeling/model_builder.py", line 214, in _single_gpu_build_func
   spatial_scale_conv
 File "/home/alex/DensePose/detectron/modeling/model_builder.py", line 306, in _add_roi_keypoint_head
   model, blob_in, dim_in, spatial_scale_in
TypeError: 'NoneType' object is not callable

What does this mean?

Incorrect config.py being imported

Running infer_simple.py:

Traceback (most recent call last):
  File "tools/infer_simple.py", line 140, in <module>
    main(args)
  File "tools/infer_simple.py", line 87, in main
    merge_cfg_from_file(args.cfg)
  File "/Detectron/detectron/core/config.py", line 1127, in merge_cfg_from_file
    _merge_a_into_b(yaml_cfg, __C)
  File "/Detectron/detectron/core/config.py", line 1181, in _merge_a_into_b
    v = _check_and_coerce_cfg_value_type(v, b[k], k, full_key)
KeyError: 'BODY_UV_RCNN'

On further investigation, it seems that the densepose version of config.py is not being loaded over the detectron version, so the BODY_UV_RCNN configs are not found.

Output of diff:

root@e8797cad84f5:/densepose# diff /Detectron/detectron/core/config.py /densepose/detectron/core/config.py

1c1,2
< # Copyright (c) 2017-present, Facebook, Inc.
---
> # Copyright (c) Facebook, Inc. and its affiliates.
> # All rights reserved.
3,13c4,5
< # Licensed under the Apache License, Version 2.0 (the "License");
< # you may not use this file except in compliance with the License.
< # You may obtain a copy of the License at
< #
< #     http://www.apache.org/licenses/LICENSE-2.0
< #
< # Unless required by applicable law or agreed to in writing, software
< # distributed under the License is distributed on an "AS IS" BASIS,
< # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
< # See the License for the specific language governing permissions and
< # limitations under the License.
---
> # This source code is licensed under the license found in the
> # LICENSE file in the root directory of this source tree.
192,194d183
< # Add StopGrad at a specified stage so the bottom layers are frozen
< __C.TRAIN.FREEZE_AT = 2
< 
476a466,468
> # Indicates the model makes body UV predictions (as in DensePose R-CNN)
> __C.MODEL.BODY_UV_ON = False
> 
856a849,899
> 
> 
> # ---------------------------------------------------------------------------- #
> # Body UV R-CNN options
> # ---------------------------------------------------------------------------- #
> __C.BODY_UV_RCNN = AttrDict()
> 
> # The type of RoI head to use for body UV prediction
> __C.BODY_UV_RCNN.ROI_HEAD = b''
> 
> # Output size (and size loss is computed on), e.g., 56x56
> __C.BODY_UV_RCNN.HEATMAP_SIZE = -1
> 
> # Use bilinear interpolation to upsample the final heatmap by this factor
> __C.BODY_UV_RCNN.UP_SCALE = -1
> 
> # Apply a ConvTranspose layer to the features prior to predicting the heatmaps
> __C.KRCNN.USE_DECONV = False
> # Channel dimension of the hidden representation produced by the ConvTranspose
> __C.BODY_UV_RCNN.DECONV_DIM = 256
> # Use a ConvTranspose layer to predict the heatmaps
> __C.BODY_UV_RCNN.USE_DECONV_OUTPUT = False
> # Use dilation in the body UV head
> __C.BODY_UV_RCNN.DILATION = 1
> # Size of the kernels to use in all ConvTranspose operations
> __C.BODY_UV_RCNN.DECONV_KERNEL = 4
> 
> # Number of patches in the dataset
> __C.BODY_UV_RCNN.NUM_PATCHES = -1
> 
> # Number of stacked Conv layers in body UV head
> __C.BODY_UV_RCNN.NUM_STACKED_CONVS = 8
> # Dimension of the hidden representation output by the body UV head
> __C.BODY_UV_RCNN.CONV_HEAD_DIM = 256
> # Conv kernel size used in the body UV head
> __C.BODY_UV_RCNN.CONV_HEAD_KERNEL = 3
> # Conv kernel weight filling function
> __C.BODY_UV_RCNN.CONV_INIT = b'GaussianFill'
> 
> # Standard ROI XFORM options (see FAST_RCNN or MRCNN options)
> __C.BODY_UV_RCNN.ROI_XFORM_METHOD = b'RoIAlign'
> __C.BODY_UV_RCNN.ROI_XFORM_RESOLUTION = 7
> __C.BODY_UV_RCNN.ROI_XFORM_SAMPLING_RATIO = 0
> 
> # Weights
> __C.BODY_UV_RCNN.INDEX_WEIGHTS = 5.0
> __C.BODY_UV_RCNN.PART_WEIGHTS = 1.0
> __C.BODY_UV_RCNN.POINT_REGRESSION_WEIGHTS = 0.001
> 
> # Train only with images that have body uv annotations
> __C.BODY_UV_RCNN.BODY_UV_IMS = False

Inference run time (Demo image)

I am not able to reach 5 fps inference time for demo image running on a titan Volta.

INFO infer_simple.py: 111: Inference time: 1.306s
INFO infer_simple.py: 113: | im_detect_bbox: 1.175s
INFO infer_simple.py: 113: | im_detect_body_uv: 0.131s
INFO infer_simple.py: 113: | misc_bbox: 0.001s

Section 3.2 report 4-5 fps on a 1080:
_

"During inference, our system operates at 25fps on 320x240 images and 4-5fps on 800x1100 images using a GTX1080 graphics card."

_

Is this timing for the full pipeline or just the im_detect_body_uv?

Here is my configuration for caffe2 / pytorch.
-- Does not need to define long separately.
-- std::exception_ptr is supported.
-- NUMA is available
-- Current compiler supports avx2 extention. Will build perfkernels.
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- Caffe2 protobuf include directory: $&lt;BUILD_INTERFACE:/home/joshua/pytorch/third_party/protobuf/src&gt;$&lt;INSTALL_INTERFACE:include>
-- The BLAS backend of choice:Eigen
-- Brace yourself, we are building NNPACK
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Caffe2: Cannot find gflags automatically. Using legacy find.
-- Caffe2: Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Caffe2: Cannot find glog automatically. Using legacy find.
-- Caffe2: Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found lmdb (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)
-- Found Snappy (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)
-- Found Numa (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnuma.so)
-- OpenCV found (/opt/ros/kinetic/share/OpenCV-3.3.1)
-- Found system Eigen at /usr/local/include/eigen3
-- Found PythonInterp: /usr/bin/python (found suitable version "2.7.12", minimum required is "2.7")
-- NumPy ver. 1.14.0 found (include: /usr/local/lib/python2.7/dist-packages/numpy/core/include)
-- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)
-- MPI support found
-- MPI compile flags:
-- MPI include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi
-- MPI LINK flags path: -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags
-- MPI libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so
CMake Warning at cmake/Dependencies.cmake:376 (message):
OpenMPI found, but it is not built with CUDA support.
Call Stack (most recent call first):
CMakeLists.txt:182 (include)

-- Caffe2: CUDA detected: 9.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 9.0
-- Found cuDNN: v7.0.5 (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s): 7.0
-- Added CUDA NVCC flags for: -gencode;arch=compute_70,code=sm_70
-- Determining NCCL version from the header file: /usr/include/nccl.h
-- NCCL_MAJOR_VERSION: 2
-- Found NCCL (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnccl.so)
-- Could NOT find CUB (missing: CUB_INCLUDE_DIR)
-- Could NOT find Gloo (missing: Gloo_INCLUDE_DIR Gloo_LIBRARY)
-- MPI include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi
-- MPI libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so
-- CUDA detected: 9.0
-- Found libcuda: /usr/local/cuda/lib64/stubs/libcuda.so
-- Found libnvrtc: /usr/local/cuda/lib64/libnvrtc.so
-- Determining NCCL version from the header file: /usr/include/nccl.h
-- NCCL_MAJOR_VERSION: 2
-- Found NCCL (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnccl.so)
-- GCC 5.4.1: Adding gcc and gcc_s libs to link line
-- Include NCCL operators
-- Excluding ideep operators as we are not using ideep
-- Including image processing operators
-- Excluding video processing operators due to no opencv
-- Excluding mkl operators as we are not using mkl
-- Include Observer library
-- Using lib/python2.7/dist-packages as python relative installation path
-- Automatically generating missing init.py files.
-- A previous caffe2 cmake run already created the init.py files.
CMake Warning at CMakeLists.txt:338 (message):
Generated cmake files are only fully tested if one builds with system glog,
gflags, and protobuf. Other settings may generate files that are not well
tested.

--
-- Summary
-- General:
-- CMake version : 3.5.2
-- CMake command : /usr/bin/cmake
-- Git version : v0.1.11-9036-g709c300-dirty
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 5.4.1
-- BLAS : Eigen
-- CXX flags : -fvisibility-inlines-hidden -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-typedef-redefinition -Wno-unknown-warning-option -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-private-field -Wno-unused-result -Wno-inconsistent-missing-override -Wno-aligned-allocation-unavailable -Wno-error=deprecated-declarations
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH :
-- CMAKE_INSTALL_PREFIX : /usr/local

-- BUILD_CAFFE2 : ON
-- BUILD_ATEN : OFF
-- BUILD_BINARY : ON
-- BUILD_CUSTOM_PROTOBUF : ON
-- Link local protobuf : ON
-- BUILD_DOCS : OFF
-- BUILD_PYTHON : ON
-- Python version : 2.7.12
-- Python includes : /usr/include/python2.7
-- BUILD_SHARED_LIBS : ON
-- BUILD_TEST : OFF
-- USE_ASAN : OFF
-- USE_ATEN : OFF
-- USE_CUDA : ON
-- CUDA static link : OFF
-- USE_CUDNN : ON
-- CUDA version : 9.0
-- cuDNN version : 7.0.5
-- CUDA root directory : /usr/local/cuda
-- CUDA library : /usr/local/cuda/lib64/stubs/libcuda.so
-- cudart library : /usr/local/cuda/lib64/libcudart_static.a;-pthread;dl;/usr/lib/x86_64-linux-gnu/librt.so
-- cublas library : /usr/local/cuda/lib64/libcublas.so;/usr/local/cuda/lib64/libcublas_device.a
-- cufft library : /usr/local/cuda/lib64/libcufft.so
-- curand library : /usr/local/cuda/lib64/libcurand.so
-- cuDNN library : /usr/local/cuda/lib64/libcudnn.so
-- nvrtc : /usr/local/cuda/lib64/libnvrtc.so
-- CUDA include path : /usr/local/cuda/include
-- NVCC executable : /usr/local/cuda/bin/nvcc
-- CUDA host compiler : /usr/bin/cc
-- USE_TENSORRT : OFF
-- USE_ROCM : OFF
-- USE_EIGEN_FOR_BLAS : ON
-- USE_FFMPEG : OFF
-- USE_GFLAGS : ON
-- USE_GLOG : ON
-- USE_GLOO : ON
-- USE_GLOO_IBVERBS : OFF
-- USE_LEVELDB : ON
-- LevelDB version : 1.18
-- Snappy version : 1.1.3
-- USE_LITE_PROTO : OFF
-- USE_LMDB : ON
-- LMDB version : 0.9.17
-- USE_METAL : OFF
-- USE_MKL :
-- USE_MOBILE_OPENGL : OFF
-- USE_MPI : ON
-- USE_NCCL : ON
-- USE_SYSTEM_NCCL : OFF
-- USE_NERVANA_GPU : OFF
-- USE_NNPACK : ON
-- USE_OBSERVERS : ON
-- USE_OPENCL : OFF
-- USE_OPENCV : ON
-- OpenCV version : 3.3.1
-- USE_OPENMP : OFF
-- USE_PROF : OFF
-- USE_REDIS : OFF
-- USE_ROCKSDB : OFF
-- USE_ZMQ : OFF
-- Public Dependencies : Threads::Threads;gflags;glog::glog
-- Private Dependencies : nnpack;cpuinfo;/usr/lib/x86_64-linux-gnu/liblmdb.so;/usr/lib/x86_64-linux-gnu/libleveldb.so;/usr/lib/x86_64-linux-gnu/libsnappy.so;/usr/lib/x86_64-linux-gnu/libnuma.so;opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;opencv_videoio;opencv_video;/usr/lib/openmpi/lib/libmpi_cxx.so;/usr/lib/openmpi/lib/libmpi.so;gloo;gcc_s;gcc;dl

test_zero_even_op failed, libcaffe2_detectron_custom_ops_gpu.so not compiled

after make ops, and run python2 test_zero_even_op.py. I Got
AssertionError: Custom ops lib not found at '/home/workplace/human_pose/densePose/densepose/build/libcaffe2_detectron_custom_ops_gpu.so'

From CmakeLists.txt, I wonder where the Flag CAFFE2_USE_CUDA is setted?
``
if (${CAFFE2_USE_CUDA})
list(APPEND CUDA_INCLUDE_DIRS -I${CAFFE2_INCLUDE_DIRS})
CUDA_ADD_LIBRARY(
caffe2_detectron_custom_ops_gpu SHARED
${CUSTOM_OPS_CPU_SRCS}
${CUSTOM_OPS_GPU_SRCS})

target_link_libraries(caffe2_detectron_custom_ops_gpu caffe2_gpu_library)
install(TARGETS caffe2_detectron_custom_ops_gpu DESTINATION lib)
endif()
``

  • I have passed the cafffe and gpu test with the following scripts:
    python2 -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
    Success
    python2 -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
    1

code error

somewhere reruire the dataset of name is coco_val2014,and somewhere require val2014
the same as coco_train2014 and train2014 in code
suchas train maybe need train2014 this format but in visualize_result.py need this format coco_val2014

About the source code for 'teacher network'

It is mentioned in the paper that there is a so-called teacher network to reconstruct the ground-truth values. I tried my best to find the code for teacher network in this published repo but with no results. So hope for a response. Thanks a lot!

text labels of body part indices

From what I understand the I-channel of the IUV image contains values in the range 1-25 corresponding to the body part/geometry. Is there a labeling for which part each value corresponds to? Like a text string like "upper left leg", "torso front".

yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/new:detectron.utils.collections.AttrDict'

When I run

python2 tools/infer_simple.py \
    --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml \
    --output-dir DensePoseData/infer_out/ \
    --image-ext jpg \
    --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl \
    DensePoseData/demo_data/demo_im.jpg

from the Getting Started page, I get the following problem. Doesn't look like the yaml parser implemented the proper constructors. I built stuff from source and I verified that all the tests in the install guide passes. Anyone else have this issue? Thanks.

Traceback (most recent call last):
  File "tools/infer_simple.py", line 140, in <module>
    main(args)
  File "tools/infer_simple.py", line 91, in main
    model = infer_engine.initialize_model_from_cfg(args.weights)
  File "/home/ubuntu/densepose/detectron/core/test_engine.py", line 333, in initialize_model_from_cfg
    model, weights_file, gpu_id=gpu_id,
  File "/home/ubuntu/densepose/detectron/utils/net.py", line 56, in initialize_gpu_from_weights_file
    saved_cfg = load_cfg(src_blobs['cfg'])
  File "/home/ubuntu/densepose/detectron/core/config.py", line 1164, in load_cfg
    return yaml.load(cfg_to_load)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/yaml/__init__.py", line 74, in load
    return loader.get_single_data()
  File "/home/ubuntu/.local/lib/python2.7/site-packages/yaml/constructor.py", line 40, in get_single_data
    return self.construct_document(node)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/yaml/constructor.py", line 44, in construct_document
    data = self.construct_object(node)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/yaml/constructor.py", line 89, in construct_object
    data = constructor(self, node)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/yaml/constructor.py", line 415, in construct_undefined
    node.start_mark)
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/new:detectron.utils.collections.AttrDict'
  in "<unicode string>", line 1, column 1:
    !!python/object/new:detectron.ut ... 

Anyone else have this issue? Thanks.

Error while make ops

Hi, there is a error while compile ops. Below is the error information
mkdir -p build && cd build && cmake .. && make -j32
-- Caffe2: Cannot find gflags automatically. Using legacy find.
-- Caffe2: Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Caffe2: Cannot find glog automatically. Using legacy find.
-- Caffe2: Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Caffe2: Found protobuf with new-style protobuf targets.
-- Caffe2: Protobuf version 3.5.0
CMake Error at /usr/local/share/cmake/Caffe2/public/cuda.cmake:35 (if):
if given arguments:

"AND" "DEFINED" "TENSORRT_ROOT"

Unknown arguments specified
Call Stack (most recent call first):
/usr/local/share/cmake/Caffe2/Caffe2Config.cmake:74 (include)
CMakeLists.txt:8 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/rongyu/work/pose_gan/util/densepose/build/CMakeFiles/CMakeOutput.log".
See also "/home/rongyu/work/pose_gan/util/densepose/build/CMakeFiles/CMakeError.log".
make: *** [ops] Error 1

Small typo in INSTALL.md

Get necessary files to run, train and evaluate DensePose.
cd $DETECTRON/DensePoseData

This should read
cd $DENSEPOSE/DensePoseData

Cheers, great work!

Keypoint estimation

I would like to know how I can generate an output for keypoint estimation. I know I have to make a config file setting KEYPOINTS_ON: True and adding the propper KRCNN: .... But my question is: is there a model in the model zoo or anywhere already trained to do this or do I have to train mine? And in that case, which model should I train?

Docker image is missing chumpy

When testing the DensePose-COCO-on-SMPL notebook on the currently provided Docker image an "no module chumpy.ch found" error occurs when trying to load the SMPL model. This can be easily fixed by running pip install chumpy inside the Docker image, but it might be a good idea to add that install to the Dockerfile.

Test with Movie

Thanks you to publish source code.
I could test demo image and own image.
But I cannot test with own movie.
So, are there any way to test with movie?

cd $DensePose && make ops

cd $DensPose && make ops
when I perform this instruction , it will tell me that

mkdir -p build && cd build && cmake .. && make -j48
-- Caffe2: Cannot find gflags automatically. Using legacy find.
-- Caffe2: Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Caffe2: Cannot find glog automatically. Using legacy find.
-- Caffe2: Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Caffe2: Found protobuf with old-style protobuf targets.
-- Caffe2: Protobuf version
CMake Error at /data/xiaobing.wang/peixuan.liang/caffe2/build/Caffe2Config.cmake:55 (message):
Your installed Caffe2 is built with protobuf , while your current cmake
setting discovers protobuf version . Please specify a protobuf version
that is the same as the built version.
Call Stack (most recent call first):
CMakeLists.txt:8 (find_package)

-- Configuring incomplete, errors occurred!
See also "/data/xiaobing.wang/peixuan.liang/DensePose-master/build/CMakeFiles/CMakeOutput.log".
See also "/data/xiaobing.wang/peixuan.liang/DensePose-master/build/CMakeFiles/CMakeError.log".
Makefile:13: recipe for target 'ops' failed
make: *** [ops] Error 1


and i could not solve this problem,what should i do?
thanks very much.

Missing masks

After running inference on a directory of several hundred frames of video and visualizing according to DensePose-RCNN-Visualize-Results.ipynb, only a handful of frames have masks overlaid. For those frames without masks, the INDS array loaded by OpenCV is empty (np.any(INDS)==False).

Examining the visualization calculations in DensePose/detectron/utils/vis.py, processing of the IUV and INDS outputs is conditional on a score threshold of 0.65; however, the frames with missing masks all have much higher scores (~1). I am not sure yet what exactly these processing steps are doing, but I assume the problem is arising there, as the masks are generated from body_uv, and the IUV outputs look plausible for all of the frames I processed.

Any insight? Thanks!

License question

Hello, the paper was super interesting! Really glad you open sourced your work.
The LICENSE file clearly indicates the code released here is usable for non-commercial work only. However, it's unclear if this license extends to the dataset that is also released here. Could you clarify?

Cannot load Pdist_matrix due to MemoryError

Hi, currently I'm using a GCP VM instance of

  • 2 CPU, 8GB
  • NVIDIA Tesla P100
    but when I try test script below, which is given from "GETTING_STARTED.md", MemoryError occurs
python2 tools/test_net.py \  
    --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml \  
    TEST.WEIGHTS https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl \  
    NUM_GPUS 1

The error occured from _loadGEval() in detectron/datasets/densepose_cocoeval.py

f = h5py.File( prefix + 'Pdist_matrix.mat')  
for k, v in f.items():  
    arrays[k] = np.array(v)

Could you please help on this problem? Or do I need more larger memory device? Isn't 12GB of P100 large enough?

undefined symbol: PyFPE_jbuf

After successful installation, I run this commad.
python2 tools/infer_simple.py \ --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml \ --output-dir DensePoseData/infer_out/ \ --image-ext jpg \ --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl \ DensePoseData/demo_data/demo_im.jpg

And error occurs as bellow:
Traceback (most recent call last): File "tools/infer_simple.py", line 34, in <module> import detectron.core.test_engine as infer_engine File "/home/ricardoliu/Source/DensePose/detectron/core/test_engine.py", line 27, in <module> from detectron.core.rpn_generator import generate_rpn_on_dataset File "/home/ricardoliu/Source/DensePose/detectron/core/rpn_generator.py", line 34, in <module> from detectron.datasets import task_evaluation File "/home/ricardoliu/Source/DensePose/detectron/datasets/task_evaluation.py", line 37, in <module> import detectron.datasets.cityscapes_json_dataset_evaluator \ File "/home/ricardoliu/Source/DensePose/detectron/datasets/cityscapes_json_dataset_evaluator.py", line 20, in <module> import pycocotools.mask as mask_util File "build/bdist.linux-x86_64/egg/pycocotools/mask.py", line 3, in <module> File "build/bdist.linux-x86_64/egg/pycocotools/_mask.py", line 7, in <module> File "build/bdist.linux-x86_64/egg/pycocotools/_mask.py", line 6, in __bootstrap__ ImportError: /home/ricardoliu/.cache/Python-Eggs/pycocotools-2.0-py2.7-linux-x86_64.egg-tmp/pycocotools/_mask.so: undefined symbol: PyFPE_jbuf

Disabling region proposal network

I would like to use my own region proposals instead of the RPN used by the model. I tried to call detectron.core.test.im_detect_body_uv directly with my own bounding box proposals, but I get a cryptic error when the code reaches this line: 'workspace.RunNet(model.body_uv_net.Proto().name)':

Traceback (most recent call last):
File "/usr/home/athar/work/framework/preprocessing/generate_dense_poses.py", line 228, in
main(parser.parse_args())
File "/usr/home/athar/work/framework/preprocessing/generate_dense_poses.py", line 213, in main
dense_pose_generator.process_dataset(dataset_path, args.min_detection_score)
File "/usr/home/athar/work/framework/preprocessing/generate_dense_poses.py", line 177, in process_dataset
iuv_mask, person_id_mask = self.detect_in_frame(frame_num)
File "/usr/home/athar/work/framework/preprocessing/generate_dense_poses.py", line 95, in detect_in_frame
iuv, inds = self.inference_engine.detect_uv_pose_from_bboxes(image, boxes, 0.694270833333)
File "/usr/home/athar/work/framework/preprocessing/detectron_inference.py", line 60, in detect_uv_pose_from_bboxes
cls_bodys = infer_engine.im_detect_body_uv(self.model, im_scale, boxes)
File "/data2/ali-working-dir/dense-pose-api/detectron/core/test.py", line 911, in im_detect_body_uv
workspace.RunNet(model.body_uv_net.Proto().name)
File "/data2/ali-working-dir/pytorch-deployed/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 217, in RunNet
StringifyNetName(name), num_iter, allow_fail,
File "/data2/ali-working-dir/pytorch-deployed/lib/python2.7/dist-packages/caffe2/python/workspace.py", line 178, in CallWithExceptionIntercept
return func(*args, **kwargs)
RuntimeError: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensorcaffe2::CUDAContext .
Offending Blob name: gpu_0/fpn_res4_22_sum.
Error from operator:
input: "gpu_0/fpn_res4_22_sum" input: "gpu_0/body_uv_rois_fpn4" output: "gpu_0/_[body_uv]_roi_feat_fpn4" name: "" type: "RoIAlign" arg { name: "pooled_h" i: 14 } arg { name: "sampling_ratio" i: 2 } arg { name: "spatial_scale" f: 0.0625 } arg { name: "pooled_w" i: 14 } device_option { device_type: 1 cuda_gpu_id: 0 }

I am assuming I'll have to modify the config file in some way to get this working, but I'm not sure. Any help?

output 2D/3D coordinates for 6890 vertices in SMPL

Thanks for making this tremendous work public available!
I have read the code of tools/infer_simple.py and the output of is UV coordinate. But I am more interested in the estimate SMPL model and I am wondering is it possible to output the 2D coordinates of the 6890 vertices given an image?

How can I acquire a commercial license?

Hello,

I would like to enquire about the procedure to acquire a license to use the code for commercial purposes. Briefly, I am currently using the Google DeepLab v3+ to create masks that I subsequently use for other purposes, and I believe that the DensePose method could be more accurate.

question about the installation of Detectron

Check that Detectron tests pass (e.g. for SpatialNarrowAsOp test):

Error:
No handlers could be found for logger "caffe2.python.net_drawer"
net_drawer will not run correctly. Please install the correct dependencies.
E0706 14:35:10.201040 28778 init_intrinsics_check.cc:59] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0706 14:35:10.201071 28778 init_intrinsics_check.cc:59] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0706 14:35:10.201086 28778 init_intrinsics_check.cc:59] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Found Detectron ops lib: /usr/local/lib/libcaffe2_detectron_ops_gpu.so
Traceback (most recent call last):
File "/home/imi/MASKRCNN/densepose/detectron/tests/test_spatial_narrow_as_op.py", line 80, in
c2_utils.import_detectron_ops()
File "/home/imi/MASKRCNN/densepose/detectron/utils/c2.py", line 34, in import_detectron_ops
dyndep.InitOpsLibrary(detectron_ops_lib)
File "/home/imi/Documents/caffe2/build/caffe2/python/dyndep.py", line 50, in InitOpsLibrary
_init_impl(name)
File "/home/imi/Documents/caffe2/build/caffe2/python/dyndep.py", line 63, in _init_impl
ctypes.CDLL(path)
File "/usr/lib/python2.7/ctypes/init.py", line 362, in init
self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/libcaffe2_detectron_ops_gpu.so: undefined symbol: _ZN6caffe231_DeviceOption_default_instance_E

don't know why ,while other operations are OK.

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.