From 9cf7b5039221b31027236aba1f2dd570a06ace89 Mon Sep 17 00:00:00 2001 From: Muhammad Rizwan Munawar Date: Mon, 2 Dec 2024 19:50:23 +0500 Subject: [PATCH] Add arguments for solutions in `usage/cfg` docs page (#17920) Co-authored-by: UltralyticsAssistant --- docs/en/guides/instance-segmentation-and-tracking.md | 8 -------- docs/en/macros/solutions-args.md | 11 +++++++++++ docs/en/usage/cfg.md | 8 ++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 docs/en/macros/solutions-args.md diff --git a/docs/en/guides/instance-segmentation-and-tracking.md b/docs/en/guides/instance-segmentation-and-tracking.md index a910a21d..12cd7477 100644 --- a/docs/en/guides/instance-segmentation-and-tracking.md +++ b/docs/en/guides/instance-segmentation-and-tracking.md @@ -82,15 +82,11 @@ There are two types of instance segmentation tracking available in the Ultralyti === "Instance Segmentation with Object Tracking" ```python - from collections import defaultdict - import cv2 from ultralytics import YOLO from ultralytics.utils.plotting import Annotator, colors - track_history = defaultdict(lambda: []) - model = YOLO("yolo11n-seg.pt") # segmentation model cap = cv2.VideoCapture("path/to/video/file.mp4") w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS)) @@ -205,15 +201,11 @@ To implement object tracking, use the `model.track` method and ensure that each === "Python" ```python - from collections import defaultdict - import cv2 from ultralytics import YOLO from ultralytics.utils.plotting import Annotator, colors - track_history = defaultdict(lambda: []) - model = YOLO("yolo11n-seg.pt") # segmentation model cap = cv2.VideoCapture("path/to/video/file.mp4") w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS)) diff --git a/docs/en/macros/solutions-args.md b/docs/en/macros/solutions-args.md new file mode 100644 index 00000000..0ce5d52a --- /dev/null +++ b/docs/en/macros/solutions-args.md @@ -0,0 +1,11 @@ +| Argument | Type | Default | Description | +| ---------------- | -------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `region` | `list` | `[(20, 400), (1080, 400), (1080, 360), (20, 360)]` | Defines the region points for object counting, queue monitoring, trackzone or speed estimation. The points are defined as coordinates forming a polygonal area for analysis. | +| `show_in` | `bool` | `True` | Indicates whether to display objects that are counted as entering the defined region. Essential for real-world analytics, such as monitoring ingress trends. | +| `show_out` | `bool` | `True` | Indicates whether to display objects that are counted as exiting the defined region. Useful for applications requiring egress tracking and analytics. | +| `colormap` | `int or tuple` | `COLORMAP_PARULA` | Specifies the OpenCV-supported colormap for heatmap visualization. Default is `COLORMAP_PARULA`, but other colormaps can be used for different visualization preferences. | +| `up_angle` | `float` | `145.0` | Angle threshold for detecting the "up" position in workouts monitoring. Can be adjusted based on the position of keypoints for different exercises. | +| `down_angle` | `float` | `90.0` | Angle threshold for detecting the "down" position in workouts monitoring. Adjust this based on keypoint positions for specific exercises. | +| `kpts` | `list` | `[6, 8, 10]` | List of keypoints 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, ab-workouts. | +| `analytics_type` | `str` | `line` | Specifies the type of analytics visualization to generate. Options include `"line"`, `"pie"`, `"bar"`, or `"area"`. The default is `"line"` for trend visualization. | +| `json_file` | `str` | `None` | Path to the JSON file defining regions for parking systems or similar applications. Enables flexible configuration of analysis areas. | diff --git a/docs/en/usage/cfg.md b/docs/en/usage/cfg.md index 95dc8b46..c51863c5 100644 --- a/docs/en/usage/cfg.md +++ b/docs/en/usage/cfg.md @@ -130,6 +130,14 @@ It is crucial to thoughtfully configure these settings to ensure the exported mo [Export Guide](../modes/export.md){ .md-button } +## Solutions Settings + +The configuration settings for Ultralytics Solutions offer a flexible way to customize the model for various tasks like object counting, heatmap creation, workout tracking, data analysis, zone tracking, queue management, and region-based counting. These options make it easy to adjust the setup for accurate and useful results tailored to specific needs. + +{% include "macros/solutions-args.md" %} + +[Solutions Guide](../solutions/index.md){ .md-button } + ## Augmentation Settings Augmentation techniques are essential for improving the robustness and performance of YOLO models by introducing variability into the [training data](https://www.ultralytics.com/glossary/training-data), helping the model generalize better to unseen data. The following table outlines the purpose and effect of each augmentation argument: