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

Method merge_outputs

tutorials/fairmot/byte_tracker.py:194–208  ·  view source on GitHub ↗
(self, detections)

Source from the content-addressed store, hash-verified

192 return dets[0]
193
194 def merge_outputs(self, detections):
195 results = {}
196 for j in range(1, self.opt.num_classes + 1):
197 results[j] = np.concatenate(
198 [detection[j] for detection in detections], axis=0).astype(np.float32)
199
200 scores = np.hstack(
201 [results[j][:, 4] for j in range(1, self.opt.num_classes + 1)])
202 if len(scores) > self.max_per_image:
203 kth = len(scores) - self.max_per_image
204 thresh = np.partition(scores, kth)[kth]
205 for j in range(1, self.opt.num_classes + 1):
206 keep_inds = (results[j][:, 4] >= thresh)
207 results[j] = results[j][keep_inds]
208 return results
209
210 def update(self, im_blob, img0):
211 self.frame_id += 1

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected