MCPcopy Index your code
hub / github.com/FoundationVision/ByteTrack / detect_rect

Class detect_rect

tutorials/ctracker/test.py:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28(0, 128, 255), (128, 255, 0), (0, 255, 128), (255, 128, 0), (255, 0, 128), (128, 128, 255), (128, 255, 128), (255, 128, 128), (128, 128, 0), (128, 0, 128)]
29
30class detect_rect:
31 def __init__(self):
32 self.curr_frame = 0
33 self.curr_rect = np.array([0, 0, 1, 1])
34 self.next_rect = np.array([0, 0, 1, 1])
35 self.conf = 0
36 self.id = 0
37
38 @property
39 def position(self):
40 x = (self.curr_rect[0] + self.curr_rect[2])/2
41 y = (self.curr_rect[1] + self.curr_rect[3])/2
42 return np.array([x, y])
43
44 @property
45 def size(self):
46 w = self.curr_rect[2] - self.curr_rect[0]
47 h = self.curr_rect[3] - self.curr_rect[1]
48 return np.array([w, h])
49
50class tracklet:
51 def __init__(self, det_rect):

Callers 1

run_each_datasetFunction · 0.85

Calls

no outgoing calls

Tested by 1

run_each_datasetFunction · 0.68