MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / velocity

Method velocity

tutorials/ctracker/test.py:66–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

64
65 @property
66 def velocity(self):
67 if(self.rect_num < 2):
68 return (0, 0)
69 elif(self.rect_num < 6):
70 return (self.rect_list[self.rect_num - 1].position - self.rect_list[self.rect_num - 2].position) / (self.rect_list[self.rect_num - 1].curr_frame - self.rect_list[self.rect_num - 2].curr_frame)
71 else:
72 v1 = (self.rect_list[self.rect_num - 1].position - self.rect_list[self.rect_num - 4].position) / (self.rect_list[self.rect_num - 1].curr_frame - self.rect_list[self.rect_num - 4].curr_frame)
73 v2 = (self.rect_list[self.rect_num - 2].position - self.rect_list[self.rect_num - 5].position) / (self.rect_list[self.rect_num - 2].curr_frame - self.rect_list[self.rect_num - 5].curr_frame)
74 v3 = (self.rect_list[self.rect_num - 3].position - self.rect_list[self.rect_num - 6].position) / (self.rect_list[self.rect_num - 3].curr_frame - self.rect_list[self.rect_num - 6].curr_frame)
75 return (v1 + v2 + v3) / 3
76
77
78def cal_iou(rect1, rect2):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected