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
In the 0.6 detectron2 release, I am using the Visualizer to verify ground truth labels using Visualizer.draw_dataset_dict. My annotations have XYXY bounding boxes and draw_dataset_dict pulls out into a list of numpy arrays, all 1 x 4, e.g.:
When Visualizer.draw_dataset_dict calls Visualizer.overlay_instances, it passes in the list of boxes (line 603). One of the first operations in overlay_instances is to process the boxes by calling _convert_boxes. (line 1227)
def _convert_boxes(self, boxes): """ Convert different format of boxes to an NxB array, where B = 4 or 5 is the box dimension. """ if isinstance(boxes, Boxes) or isinstance(boxes, RotatedBoxes): return boxes.tensor.detach().numpy() else: return np.array(boxes)
The list falls into the else leg. With numpy 2.2.6 this produces a 4 x 1 x 4 tensor which causes problems down the road. While it can easily be fixed by changing np.array to np.vstack, I was wondering if my data were wrong (I'm well versed in ML, not in detectron2).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In the 0.6 detectron2 release, I am using the Visualizer to verify ground truth labels using Visualizer.draw_dataset_dict. My annotations have XYXY bounding boxes and draw_dataset_dict pulls out into a list of numpy arrays, all 1 x 4, e.g.:
[array([[553., 209., 773., 227.]], dtype=float32), array([[ 951., 250., 1341., 290.]], dtype=float32), array([[1974., 207., 2227., 227.]], dtype=float32), array([[2390., 251., 2771., 289.]], dtype=float32)]
When Visualizer.draw_dataset_dict calls Visualizer.overlay_instances, it passes in the list of boxes (line 603). One of the first operations in overlay_instances is to process the boxes by calling _convert_boxes. (line 1227)
def _convert_boxes(self, boxes): """ Convert different format of boxes to an NxB array, where B = 4 or 5 is the box dimension. """ if isinstance(boxes, Boxes) or isinstance(boxes, RotatedBoxes): return boxes.tensor.detach().numpy() else: return np.array(boxes)The list falls into the else leg. With numpy 2.2.6 this produces a 4 x 1 x 4 tensor which causes problems down the road. While it can easily be fixed by changing np.array to np.vstack, I was wondering if my data were wrong (I'm well versed in ML, not in detectron2).
Thanks - Marie
Beta Was this translation helpful? Give feedback.
All reactions