Issue:
I can't share my code but below is a minimal code sample to reproduce the error. My code calls the function DensePoseDataPointsVisualizer() and internally it calls PointsVisualizer(), at the 108 line cv2.circle() gets called, but as the centre coordinates passed in that function is in float, cv2 throws an error, as cv2.circle() expects integer pixel coordinates as centre.
DensePoseDataPointsVisualizer()
and internally it callsPointsVisualizer()
, at the 108 linecv2.circle()
gets called, but as the centre coordinates passed in that function is in float, cv2 throws an error, ascv2.circle()
expects integer pixel coordinates as centre.Here is the google colab notebbok that reproduces the error.
/content/detectron2/projects/DensePose/densepose/vis/base.py in visualize(self, image_bgr, pts_xy, colors_bgr, rs) 106 color_bgr = colors_bgr[j] if colors_bgr is not None else self.color_bgr 107 r = rs[j] if rs is not None else self.r --> 108 cv2.circle(image_bgr, (x, y), r, color_bgr, -1) 109 return image_bgr 110
error: OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function 'circle'
x, y = pt_xy
tox, y = [int(val) for val in pt_xy]
https://github.com/soumya997/detectron2/blob/somusan-fixes/projects/DensePose/densepose/vis/base.py#L95C1-L109C25
git rev-parse HEAD; git diff
0f3f9920d3e98e4db7442c19262d5f0eade25581