You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于Ultralytics YOLO集成StrongSort跟踪算法的实现求助

基于Ultralytics YOLO集成StrongSort跟踪算法的实现求助

我正在做一个项目,需要把YOLO目标检测算法和不同的跟踪算法结合起来,目前在尝试集成StrongSort跟踪的时候遇到了瓶颈。有没有大佬能指点一下,怎么借助GitHub上的StrongSort仓库完成集成?另外,我该怎么把自己YOLO的检测结果传递给StrongSort跟踪算法呢?

附上我当前的YOLO检测代码:

from ultralytics import YOLO

class YoloDetector:
  def __init__(self, model_path, confidence):
    self.model = YOLO(model_path)
    self.classList = ["person"]
    self.confidence = confidence

  def detect(self, image):
    results = self.model.predict(image, conf=self.confidence)
    result = results[0]
    detections = self.make_detections(result)
    return detections

  def make_detections(self, result):
    boxes = result.boxes
    detections = []
    for box in boxes:
      x1, y1, x2, y2 = box.xyxy[0]
      x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
      w, h = x2 - x1, y2 - y1
      class_number = int(box.cls[0])

      if result.names[class_number] not in self.classList:
        continue
      conf = box.conf[0]
      detections.append((([x1, y1, w, h]), class_number, conf))
    return detections

备注:内容来源于stack exchange,提问作者ofhgof

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 19:59:32