Skip to content

Commit cf65829

Browse files
committed
fix center_x, center_y
1 parent 45def67 commit cf65829

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

detect_and_track.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ def draw_boxes(img, bbox, identities=None, categories=None, names=None, save_wit
4545
txt_str = ""
4646
if save_with_object_id:
4747
txt_str += "%i %i %f %f %f %f %f %f" % (
48-
id, cat, int(box[0])/img.shape[1], int(box[1])/img.shape[0] , int(box[2])/img.shape[1], int(box[3])/img.shape[0] ,int(box[0] + (box[2] * 0.5))/img.shape[1] ,
49-
int(box[1] + (
50-
box[3]* 0.5))/img.shape[0])
48+
id,
49+
cat,
50+
int(box[0]) / img.shape[1],
51+
int(box[1]) / img.shape[0],
52+
int(box[2]) / img.shape[1],
53+
int(box[3]) / img.shape[0],
54+
int(box[0] + box[2]) * 0.5 / img.shape[1],
55+
int(box[1] + box[3]) * 0.5 / img.shape[0],
56+
)
5157
txt_str += "\n"
5258
with open(path + '.txt', 'a') as f:
5359
f.write(txt_str)

0 commit comments

Comments
 (0)