Ultralytics YOLO26: train on VisDrone and count vehicles

Train YOLO26 nano on VisDrone for 50 epochs, download the weights, and use a Python script for vehicle tracking and line counting.

Player not loading? Watch on YouTube

This tutorial follows a drone traffic analytics workflow with Ultralytics YOLO26 and VisDrone. The presenter trains a vehicle detection model in the Ultralytics Platform, then downloads the PyTorch weights to run inference in a Python script on their own computer. Training takes place on the platform's selected GPU, separate from the local inference demonstration.

The training example uses YOLO26 nano for 50 epochs and leaves the remaining settings at their defaults. The presenter reviews training metrics and tests predictions before explaining the model download and export options. The dataset includes aerial scenes with vehicles and pedestrians, while the demonstration focuses on traffic.

The Python walkthrough explains model weights, input sources, tracking IDs and annotated video output. It uses model.track to follow objects across frames and count vehicles crossing a configured line. Arguments control tracking, counting, confidence and the source video. The presenter notes that a different video needs its own line coordinates.

The final demonstration runs detection, tracking and counting on traffic footage and saves the annotated results to an output video. Viewers also see how to substitute another weights path or video source.