Ultralytics YOLO27: Join the waitlist.
Get Started

Ultralytics Solutions: Harness YOLO26 to Solve Real-World Problems#

Ultralytics Solutions are ready-to-use applications of Ultralytics YOLO models for common computer vision problems such as object counting, heatmaps, speed estimation, queue management, and object blurring. Most solutions wrap detection, tracking, or pose estimation in a configurable class that you can run from Python or the yolo solutions CLI.

Ultralytics Solutions Thumbnail



Watch: How to Run Ultralytics Solutions from the Command Line (CLI) | Ultralytics YOLO26 🚀

Solutions#

Each solution below has a dedicated guide:

Solutions Arguments#

ArgumentTypeDefaultDescription
modelstrNonePath to an Ultralytics YOLO model file.
regionlist or dictNonePoints defining the region of interest, either a list of (x, y) tuples or a dictionary mapping region names to point lists for multiple regions (RegionCounter only). When None, solutions that require a region fall back to a predefined default.
show_inboolTrueFlag to control whether to display the in counts on the video stream.
show_outboolTrueFlag to control whether to display the out counts on the video stream.
analytics_typestr'line'Type of graph, i.e., line, bar, area, or pie.
colormapintcv2.COLORMAP_DEEPGREENColormap to use for the heatmap.
line_widthint2Line thickness for the boxes, keypoints and counts the solution draws.
verboseboolTrueEnables the solution's per-frame log of input shape, class counts and processing speed. The tracking call itself is always silent.
json_filestrNonePath to the JSON file that contains all parking coordinates data.
up_anglefloat145.0Angle threshold for the 'up' pose.
kptslist[int][6, 8, 10]List of three keypoint indices used for monitoring workouts. These keypoints correspond to body joints or parts, such as shoulders, elbows, and wrists, for exercises like push-ups, pull-ups, squats, and ab-workouts.
down_anglefloat90.0Angle threshold for the 'down' pose.
blur_ratiofloat0.5Adjusts percentage of blur intensity, with values in range 0.1 - 1.0.
crop_dirstr'cropped-detections'Directory name for storing cropped detections.
recordsint5Total detections count to trigger an email with security alarm system.
vision_pointtuple[int, int](20, 20)The point where vision will track objects and draw paths using VisionEye Solution.
sourcestrNonePath to the input source (video, RTSP, etc.). Only usable with Solutions command line interface (CLI).
figsizetuple[float, float](12.8, 7.2)Figure size in inches for Analytics charts; (12.8, 7.2) renders a 1280×720 frame.
fpsfloat30.0Frames per second used for speed calculations.
max_histint5Maximum historical points to track per object for speed/direction calculations.
meter_per_pixelfloat0.05Scaling factor used for converting pixel distance to real-world units.
max_speedint120Maximum speed in km/h; higher estimated speeds are capped at this value.
datastr'images'Path to image directory used for similarity search.
imgszint640Input image size for model inference.
Track args

Solutions forward the inference and tracking arguments below to model.track().

ArgumentTypeDefaultDescription
trackerstr'tracktrack.yaml'Specifies the tracking algorithm to use. Built-in options: botsort.yaml, bytetrack.yaml, ocsort.yaml, deepocsort.yaml, fasttrack.yaml, tracktrack.yaml.
conffloat0.25Sets the confidence threshold for detections; lower values allow more objects to be tracked but may include false positives.
ioufloat0.7Sets the Intersection over Union (IoU) threshold for filtering overlapping detections.
classeslistNoneFilters results by class index. For example, classes=[0, 2, 3] only tracks the specified classes.
devicestrNoneSpecifies the device for inference (e.g., cpu, cuda:0 or 0). Allows users to select between CPU, a specific GPU, or other compute devices for model execution.
imgszint or tuple640Target inference image size: an integer for a square or a (height, width) pair. Shapes are adjusted to the model stride.
max_detint300Maximum number of detections kept per frame before tracking, limiting the objects a solution processes in dense scenes.
quantizeint or strNoneInference precision: 16 (FP16) or 32/unset (FP32) for PyTorch and TorchScript models off CPU; other formats use the precision their artifact and runtime select. Replaces the deprecated half arg.
Visualization args

You can use show_conf, show_labels, and other mentioned arguments to customize the visualization.

ArgumentTypeDefaultDescription
showboolFalseIf True, displays the annotated images or videos in a window. Useful for immediate visual feedback during development or testing.
show_confboolTrueDisplays the confidence score for each detection alongside the label. Gives insight into the model's certainty for each detection.
show_labelsboolTrueDisplays labels for each detection in the visual output. Provides immediate understanding of detected objects.

Usage of SolutionAnnotator#

All Ultralytics Solutions use the SolutionAnnotator class, which extends the main Annotator class and provides the following methods:

MethodReturn TypeDescription
draw_region()NoneDraws a region using specified points, colors, and thickness.
queue_counts_display()NoneDisplays queue counts in the specified region.
display_analytics()NoneDisplays overall statistics for parking lot management.
estimate_pose_angle()floatCalculates the angle between three points in an object pose.
draw_specific_kpts()np.ndarrayDraws specific keypoints on the image.
plot_workout_information()intDraws a labeled text box on the image.
plot_angle_and_count_and_stage()NoneVisualizes angle, step count, and stage for workout monitoring.
plot_distance_and_line()NoneDisplays the distance between centroids and connects them with a line.
display_objects_labels()NoneAnnotates bounding boxes with object class labels.
sweep_annotator()NoneVisualizes a vertical sweep line and optional label.
visioneye()NoneMaps and connects object centroids to a visual "eye" point.
adaptive_label()NoneDraws a circular or rectangular background label in the center of a bounding box.

Working with SolutionResults#

Every solution except Similarity Search returns a SolutionResults object when called.

  • For object counting, the results include in_count, out_count, and classwise_count.
SolutionResults
import cv2

from ultralytics import solutions

im0 = cv2.imread("path/to/img")

region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)]

counter = solutions.ObjectCounter(
    show=True,  # display the output
    region=region_points,  # pass region points
    model="yolo26n.pt",  # model="yolo26n-obb.pt" for object counting with OBB model.
    # classes=[0, 2],  # count specific classes i.e. person and car with COCO pretrained model.
    # tracker="botsort.yaml"  # Choose trackers i.e "bytetrack.yaml"
)
results = counter(im0)
print(results.in_count)  # display in_counts
print(results.out_count)  # display out_counts
print(results.classwise_count)  # display classwise_count

SolutionResults objects have the following attributes:

AttributeTypeDescription
plot_imnp.ndarrayImage with visual overlays such as counts, blur effects, or solution-specific enhancements.
in_countintTotal number of objects detected entering the defined zone in the video stream.
out_countintTotal number of objects detected exiting the defined zone in the video stream.
classwise_countdict[str, dict[str, int] | int]Per-class counts: {"IN": int, "OUT": int} for ObjectCounter and Heatmap, or an int for Analytics.
queue_countintNumber of objects currently within a predefined queue or waiting area (suitable for queue management).
workout_countlist[int]Per-track workout repetition counts from AI Gym (one entry per currently tracked individual).
workout_anglelist[float]Per-track exercise angles from AI Gym (one entry per currently tracked individual).
workout_stagelist[str]Per-track current workout stage from AI Gym (one entry per currently tracked individual).
pixels_distancefloatPixel-based distance between two objects or points, such as bounding boxes (suitable for distance calculation).
available_slotsintNumber of unoccupied slots in a monitored area (suitable for parking management).
filled_slotsintNumber of occupied slots in a monitored area (suitable for parking management).
email_sentboolIndicates whether a notification or alert email has been successfully sent (suitable for security alarm).
total_tracksintTotal number of unique object tracks observed during video analysis.
region_countsdict[str, int]Object counts within user-defined regions or zones.
speed_dictdict[int, int]Track-wise dictionary of estimated object speeds in km/h from SpeedEstimator, useful for velocity analysis.
total_crop_objectsintTotal number of cropped object images generated by the ObjectCropper solution.
speeddict[str, float]Dictionary containing performance metrics for tracking and solution processing.

For more details, refer to the SolutionResults class documentation.

Solutions Usage via CLI#

Command Info

Most solutions can be run directly from the command-line interface.

Syntax

yolo SOLUTIONS SOLUTION_NAME ARGS
  • SOLUTIONS is a required keyword.
  • SOLUTION_NAME is one of: ['count', 'crop', 'blur', 'workout', 'heatmap', 'isegment', 'queue', 'speed', 'analytics', 'trackzone', 'inference', 'visioneye', 'region', 'security', 'parking'].
  • ARGS (optional) are custom arg=value pairs, such as show_in=True, to override default settings.
yolo solutions count show=True # for object counting

yolo solutions count source="path/to/video.mp4" # specify video file path

Contribute to Our Solutions#

Community contributions are welcome. If you have built a solution with Ultralytics YOLO that is not covered here, consider sharing it as a guide so other users can benefit.

FAQ#

  • Ultralytics YOLO26 counts objects in real time by combining detection with tracking, so each object is counted once as it crosses a line or enters a region. To set up YOLO26 for live video stream analysis, install ultralytics, load a model, and pass video frames to solutions.ObjectCounter.

  • Ultralytics YOLO26 adds real-time object detection and alerting to camera-based security systems. With the Security Alarm System solution, YOLO26 sends an email alert when the number of detected objects in the surveillance area reaches a threshold.

  • Ultralytics YOLO26 counts and tracks people inside a queue region, giving you live queue lengths that help reduce wait times and plan staffing.

  • Yes. Ultralytics YOLO26 pose models track body keypoints in real time, so the workout monitoring solution can measure joint angles, count repetitions, and report the current exercise stage.

  • Ultralytics YOLO26 can generate heatmaps that show where objects appear or move most often in a scene, highlighting regions of high activity. These data visualizations help you understand traffic patterns and trends over time.

Comments