kareemamr
(Kareem Amr)
April 11, 2021, 6:48pm
1
I’m trying to draw a bounding box over an image using the draw_bounding_boxes
function but am faced with this error.
Here is the code:
img = cv2.imread(img_path, 0)
img = torch.unsqueeze(torch.Tensor(img), 0)
img = img.type(torch.uint8)
res = draw_bounding_boxes(img, bbox)
Can anyone help with this?
Could you check the type of bbox
? Based on the docs a tensor is expected and the error message points towards a wrong type in a numpy array, if I’m not mistaken.
kareemamr
(Kareem Amr)
April 12, 2021, 6:05pm
3
Yes I verified that bbox
was of type Tensor
Could you post an executable code snippet (using random tensors) so that we could reproduce this issue, please?