• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


25 Mar, 2025

Updated at 20 May, 2025

Implementing StrongSort with Ultralytics YOLO

I have a project where I am implementing the Yolo object detection algorithm with different tracking algorithms. I am now struggling to implement the StrongSort tracking with my detection program. Can someone explain how I should implement the algorithm with the use of a GitHub repo. How can I feed the detection results into the tracking algorithm? This is my detection algorithm:

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