facebookresearch/DensePose

Bounding box and IUV array size inconsistency

tobyshooters opened this issue · 1 comments

I'm writing my own post-processing step for DensePose. I want to align the IUV output to my source image. To do this, I use the bbox_XYXY to copy the IUV array into a larger np.zeros(frame.shape).

Very frequently I get an off-by-1 error, but not always.

iuv[y1:y2, x1:x2] = obj["iuv"].transpose(1,2,0)
Value Error: could not broadcast input array from shape (553,385,3) into shape (554,385,3)

This is likely a rounding error somewhere in the Densepose pipeline. After looking around the codebase, I've realized that for visualization, you resize the array to match the image.

github.com/facebookresearch/detectron2/blob/master/projects/DensePose/densepose/vis/base.py#L42

I wanted to double-check that the reason for the resize is this rounding error, or if there's a bug somewhere else in my code.

hithd commented

hello @tobyshooters , have you finished you project yet ? What i am doing now is quite familiar with your step . I am trying to use the IUV output to find specific point of the image and point it in the original image . I would be quite grateful if you can show me your step or code.