ultralytics 8.2.57 new Solutions Tests and Docs (#14408)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
100a73b6e9
commit
c67a3039c1
12 changed files with 143 additions and 50 deletions
|
|
@ -24,7 +24,7 @@ class DistanceCalculation:
|
|||
Initializes the DistanceCalculation class with the given parameters.
|
||||
|
||||
Args:
|
||||
names (dict): Dictionary mapping class indices to class names.
|
||||
names (dict): Dictionary of classes names.
|
||||
pixels_per_meter (int, optional): Conversion factor from pixels to meters. Defaults to 10.
|
||||
view_img (bool, optional): Flag to indicate if the video stream should be displayed. Defaults to False.
|
||||
line_thickness (int, optional): Thickness of the lines drawn on the image. Defaults to 2.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class Heatmap:
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
classes_names,
|
||||
names,
|
||||
imw=0,
|
||||
imh=0,
|
||||
colormap=cv2.COLORMAP_JET,
|
||||
|
|
@ -44,7 +44,7 @@ class Heatmap:
|
|||
self.shape = shape
|
||||
|
||||
self.initialized = False
|
||||
self.names = classes_names # Classes names
|
||||
self.names = names # Classes names
|
||||
|
||||
# Image information
|
||||
self.imw = imw
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class ObjectCounter:
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
classes_names,
|
||||
names,
|
||||
reg_pts=None,
|
||||
count_reg_color=(255, 0, 255),
|
||||
count_txt_color=(0, 0, 0),
|
||||
|
|
@ -37,7 +37,7 @@ class ObjectCounter:
|
|||
Initializes the ObjectCounter with various tracking and counting parameters.
|
||||
|
||||
Args:
|
||||
classes_names (dict): Dictionary of class names.
|
||||
names (dict): Dictionary of class names.
|
||||
reg_pts (list): List of points defining the counting region.
|
||||
count_reg_color (tuple): RGB color of the counting region.
|
||||
count_txt_color (tuple): RGB color of the count text.
|
||||
|
|
@ -72,7 +72,7 @@ class ObjectCounter:
|
|||
self.view_in_counts = view_in_counts
|
||||
self.view_out_counts = view_out_counts
|
||||
|
||||
self.names = classes_names # Classes names
|
||||
self.names = names # Classes names
|
||||
self.annotator = None # Annotator
|
||||
self.window_name = "Ultralytics YOLOv8 Object Counter"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class QueueManager:
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
classes_names,
|
||||
names,
|
||||
reg_pts=None,
|
||||
line_thickness=2,
|
||||
track_thickness=2,
|
||||
|
|
@ -34,7 +34,7 @@ class QueueManager:
|
|||
Initializes the QueueManager with specified parameters for tracking and counting objects.
|
||||
|
||||
Args:
|
||||
classes_names (dict): A dictionary mapping class IDs to class names.
|
||||
names (dict): A dictionary mapping class IDs to class names.
|
||||
reg_pts (list of tuples, optional): Points defining the counting region polygon. Defaults to a predefined
|
||||
rectangle.
|
||||
line_thickness (int, optional): Thickness of the annotation lines. Defaults to 2.
|
||||
|
|
@ -69,7 +69,7 @@ class QueueManager:
|
|||
self.view_queue_counts = view_queue_counts
|
||||
self.fontsize = fontsize
|
||||
|
||||
self.names = classes_names # Class names
|
||||
self.names = names # Class names
|
||||
self.annotator = None # Annotator
|
||||
self.window_name = "Ultralytics YOLOv8 Queue Manager"
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ class QueueManager:
|
|||
|
||||
def display_frames(self):
|
||||
"""Displays the current frame with annotations."""
|
||||
if self.env_check:
|
||||
if self.env_check and self.view_img:
|
||||
self.annotator.draw_region(reg_pts=self.reg_pts, thickness=self.region_thickness, color=self.region_color)
|
||||
cv2.namedWindow(self.window_name)
|
||||
cv2.imshow(self.window_name, self.im0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue