pytorch-yolo-v3 icon indicating copy to clipboard operation
pytorch-yolo-v3 copied to clipboard

Bbox coordinates

Open QizhengWu opened this issue 5 years ago • 4 comments

Can anyone please help me figure out where can I get the bounding boxes coordinates and confidences? For each input image, we detect the objects and label them with the bounding boxes in the output image, and I was wondering in which part of the code can I get the coordinates and confidences of the boxes. Thanks a lot.

QizhengWu avatar May 12 '19 02:05 QizhengWu

def write(x, batches, results):
    count=0
    c1 = tuple(x[1:3].int())
    print ('x1,y1: ', x[1],x[2])
    c2 = tuple(x[3:5].int())
    print('x2,y2: ',  x[3],x[4])
    img = results[int(x[0])]
    cls = int(x[-1])
    label = "{0}".format(classes[cls])

Note that x1,y1 are the coords for top left vertex, while x2,y2 are bottom right

Shaier avatar Jun 03 '19 03:06 Shaier

If I want to save the coordinates of the boxes as csv or text, what should I do?

iPersevere avatar Jun 14 '19 05:06 iPersevere

The output is coming as x1,y1: tensor(673.1793, device='cuda:0') tensor(390.7069, device='cuda:0') x2,y2: tensor(1217.8958, device='cuda:0') tensor(930.1056, device='cuda:0')

@Shaier @ayooshkathuria does it means the top left = [673.1793, 390.7069] bottom right = [1217.8958, 930.1056] ??

why its coming as in this format?

spaul13 avatar Sep 18 '19 22:09 spaul13

@iPersevere so ,do you slove that problems?

nanhui69 avatar Nov 11 '19 00:11 nanhui69