Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The DensePose-RCNN system is implemented within the [`detectron`](https://github

## Caffe2

To install Caffe2 with CUDA support, follow the [installation instructions](https://caffe2.ai/docs/getting-started.html) from the [Caffe2 website](https://caffe2.ai/). **If you already have Caffe2 installed, make sure to update your Caffe2 to a version that includes the [Detectron module](https://github.com/caffe2/caffe2/tree/master/modules/detectron).**
To install Caffe2 with CUDA support, follow the [installation instructions](https://caffe2.ai/docs/getting-started.html) from the [Caffe2 website](https://caffe2.ai/). **If you already have Caffe2 installed, make sure to update your Caffe2 to a version that includes the [Detectron module](https://github.com/pytorch/pytorch/tree/master/modules/detectron).**

Please ensure that your Caffe2 installation was successful before proceeding by running the following commands and checking their output as directed in the comments.

Expand Down Expand Up @@ -130,7 +130,7 @@ coco

## Docker Image

We provide a [`Dockerfile`](docker/Dockerfile) that you can use to build a Densepose image on top of a Caffe2 image that satisfies the requirements outlined at the top. If you would like to use a Caffe2 image different from the one we use by default, please make sure that it includes the [Detectron module](https://github.com/caffe2/caffe2/tree/master/modules/detectron).
We provide a [`Dockerfile`](docker/Dockerfile) that you can use to build a Densepose image on top of a Caffe2 image that satisfies the requirements outlined at the top. If you would like to use a Caffe2 image different from the one we use by default, please make sure that it includes the [Detectron module](https://github.com/pytorch/pytorch/tree/master/modules/detectron).

Build the image:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _Rıza Alp Güler, Natalia Neverova, Iasonas Kokkinos_
[[`densepose.org`](https://densepose.org)] [[`arXiv`](https://arxiv.org/abs/1802.00434)] [[`BibTeX`](#CitingDensePose)]

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](https://github.com/facebookresearch/Detectron) framework and is powered by [Caffe2](https://github.com/caffe2/caffe2).
DensePose-RCNN is implemented in the [Detectron](https://github.com/facebookresearch/Detectron) framework and is powered by [Caffe2](https://github.com/pytorch/pytorch/tree/master/caffe2).

<div align="center">
<img src="https://drive.google.com/uc?export=view&id=1qfSOkpueo1kVZbXOuQJJhyagKjMgepsz" width="700px" />
Expand Down
5 changes: 4 additions & 1 deletion detectron/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@
__C.BODY_UV_RCNN.UP_SCALE = -1

# Apply a ConvTranspose layer to the features prior to predicting the heatmaps
__C.KRCNN.USE_DECONV = False
__C.BODY_UV_RCNN.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
Expand All @@ -876,6 +876,9 @@
# Number of patches in the dataset
__C.BODY_UV_RCNN.NUM_PATCHES = -1

# Number of semantic parts used to sample annotation points
__C.BODY_UV_RCNN.NUM_SEMANTIC_PARTS = 14

# 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
Expand Down
6 changes: 3 additions & 3 deletions detectron/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,16 +948,16 @@ def im_detect_body_uv(model, im_scale, boxes):
# Removed squeeze calls due to singleton dimension issues
CurAnnIndex = np.argmax(CurAnnIndex, axis=0)
CurIndex_UV = np.argmax(CurIndex_UV, axis=0)
CurIndex_UV = CurIndex_UV * (CurAnnIndex>0).astype(np.float32)
CurIndex_UV = CurIndex_UV * (CurAnnIndex > 0).astype(np.float32)

output = np.zeros([3, int(by), int(bx)], dtype=np.float32)
output[0] = CurIndex_UV

for part_id in range(1, K):
CurrentU = CurU_uv[part_id]
CurrentV = CurV_uv[part_id]
output[1, CurIndex_UV==part_id] = CurrentU[CurIndex_UV==part_id]
output[2, CurIndex_UV==part_id] = CurrentV[CurIndex_UV==part_id]
output[1, CurIndex_UV == part_id] = CurrentU[CurIndex_UV == part_id]
output[2, CurIndex_UV == part_id] = CurrentV[CurIndex_UV == part_id]
outputs.append(output)

num_classes = cfg.MODEL.NUM_CLASSES
Expand Down
9 changes: 6 additions & 3 deletions detectron/core/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def get_roidb_and_dataset(dataset_name, proposal_file, ind_range):


def empty_results(num_classes, num_images):
"""Return empty results lists for boxes, masks, and keypoints.
"""Return empty results lists for boxes, masks, keypoints and body IUVs.
Box detections are collected into:
all_boxes[cls][image] = N x 5 array with columns (x1, y1, x2, y2, score)
Instance mask predictions are collected into:
Expand All @@ -386,8 +386,11 @@ def empty_results(num_classes, num_images):
[x, y, logit, prob] (See: utils.keypoints.heatmaps_to_keypoints).
Keypoints are recorded for person (cls = 1); they are in 1:1
correspondence with the boxes in all_boxes[cls][image].
Body uv predictions are collected into:
TODO
Body IUV predictions are collected into:
all_bodys[cls][image] = [...] list of body IUV results that are in 1:1
correspondence with the boxes in all_boxes['person'][image], each encoded
as a 3D array (3, int(bbox_height), int(bbox_width)) with the 3 rows
corresponding to [Index, U, V].
"""
# Note: do not be tempted to use [[] * N], which gives N references to the
# *same* empty list.
Expand Down
Loading