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

Method merge_outputs

tutorials/fairmot/tracker.py:216–230  ·  view source on GitHub ↗
(self, detections)

Source from the content-addressed store, hash-verified

214 return dets[0]
215
216 def merge_outputs(self, detections):
217 results = {}
218 for j in range(1, self.opt.num_classes + 1):
219 results[j] = np.concatenate(
220 [detection[j] for detection in detections], axis=0).astype(np.float32)
221
222 scores = np.hstack(
223 [results[j][:, 4] for j in range(1, self.opt.num_classes + 1)])
224 if len(scores) > self.max_per_image:
225 kth = len(scores) - self.max_per_image
226 thresh = np.partition(scores, kth)[kth]
227 for j in range(1, self.opt.num_classes + 1):
228 keep_inds = (results[j][:, 4] >= thresh)
229 results[j] = results[j][keep_inds]
230 return results
231
232 def update(self, im_blob, img0):
233 self.frame_id += 1

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected