I am running my yolo11 people detection model on the personpath22 dataset then evaluating the results using trackeval, im using the following code to save the tracking results for comparison:
from ultralytics import YOLO
import os
# Load trained model
model = YOLO("yolo11s.pt") (also tried w model trained on roboflow crowd dataset)
path = "/content/drive/MyDrive/tracking-dataset/dataset/personpath22/raw_data"
dir = os.listdir(path)
from os import path
with open('/content/drive/MyDrive/TrackEval/data/gt/person_path_22/seqmaps/person_path_22-test.txt','r') as f:
file_names = [l.strip() for l in f.readlines()]
for file in dir:
if file in file_names:
# Perform tracking on your video or image sequence
results = model.track(source='/content/drive/MyDrive/tracking-dataset/dataset/personpath22/raw_data/'+file, classes=0, persist=True,stream=True)
# Save results in MOTChallenge format (frame, id, bbox, conf)
with open(f"/content/drive/MyDrive/TrackEval/data/trackers/person_path_22-test/yolo_bot/data/{file}.txt", 'w') as f:
for frame_id, result in enumerate(results):
for box in result.boxes:
# Check if box.id is not None before accessing its attributes
if box.id is not None:
bbox = box.xyxy[0].tolist() # Convert from tensor to list
track_id = box.id.item() # Get track id
conf = box.conf.item() # Get confidence score
f.write(f'{frame_id+1},{track_id},{bbox[0]},{bbox[1]},{bbox[2]-bbox[0]},{bbox[3]-bbox[1]},{conf},-1,-1,-1\n')
I got a result of HOTA=36.31, MOTA= 38.25, IDF1=39.15. The results are very low compared to benchmarks of around 80. the model did very good on detection. how can I improve these results?