pytorch-yolo-v3
pytorch-yolo-v3 copied to clipboard
Bbox coordinates
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.
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
If I want to save the coordinates of the boxes as csv or text, what should I do?
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?
@iPersevere so ,do you slove that problems?