You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
---------------------------------------------------------------------------
error Traceback (most recent call last)
[<ipython-input-3-fe6e38084d89>](https://localhost:8080/#) in <cell line: 2>()
1 viz_func = PointsVisualizer()
----> 2 viz_func.visualize(image, centers)
[/content/detectron2/projects/DensePose/densepose/vis/base.py](https://localhost:8080/#) 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'
> Overload resolution failed:
> - Can't parse 'center'. Sequence item with index 0 has a wrong type
> - Can't parse 'center'. Sequence item with index 0 has a wrong type
Changes Made:
changed, x, y = pt_xy
to x, y = [int(val) for val in pt_xy]
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 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.
changed,
x, y = pt_xy
to
x, 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
The text was updated successfully, but these errors were encountered: