|
|
@ -591,8 +591,8 @@ class Annotator: |
|
|
|
Args: |
|
|
|
Args: |
|
|
|
label (str): queue counts label |
|
|
|
label (str): queue counts label |
|
|
|
points (tuple): region points for center point calculation to display text |
|
|
|
points (tuple): region points for center point calculation to display text |
|
|
|
region_color (RGB): queue region color |
|
|
|
region_color (tuple): RGB queue region color. |
|
|
|
txt_color (RGB): text display color |
|
|
|
txt_color (tuple): RGB text display color. |
|
|
|
""" |
|
|
|
""" |
|
|
|
x_values = [point[0] for point in points] |
|
|
|
x_values = [point[0] for point in points] |
|
|
|
y_values = [point[1] for point in points] |
|
|
|
y_values = [point[1] for point in points] |
|
|
@ -631,8 +631,8 @@ class Annotator: |
|
|
|
Args: |
|
|
|
Args: |
|
|
|
im0 (ndarray): inference image |
|
|
|
im0 (ndarray): inference image |
|
|
|
text (str): object/class name |
|
|
|
text (str): object/class name |
|
|
|
txt_color (bgr color): display color for text foreground |
|
|
|
txt_color (tuple): display color for text foreground |
|
|
|
bg_color (bgr color): display color for text background |
|
|
|
bg_color (tuple): display color for text background |
|
|
|
x_center (float): x position center point for bounding box |
|
|
|
x_center (float): x position center point for bounding box |
|
|
|
y_center (float): y position center point for bounding box |
|
|
|
y_center (float): y position center point for bounding box |
|
|
|
margin (int): gap between text and rectangle for better display |
|
|
|
margin (int): gap between text and rectangle for better display |
|
|
@ -655,8 +655,8 @@ class Annotator: |
|
|
|
Args: |
|
|
|
Args: |
|
|
|
im0 (ndarray): inference image |
|
|
|
im0 (ndarray): inference image |
|
|
|
text (dict): labels dictionary |
|
|
|
text (dict): labels dictionary |
|
|
|
txt_color (bgr color): display color for text foreground |
|
|
|
txt_color (tuple): display color for text foreground |
|
|
|
bg_color (bgr color): display color for text background |
|
|
|
bg_color (tuple): display color for text background |
|
|
|
margin (int): gap between text and rectangle for better display |
|
|
|
margin (int): gap between text and rectangle for better display |
|
|
|
""" |
|
|
|
""" |
|
|
|
horizontal_gap = int(im0.shape[1] * 0.02) |
|
|
|
horizontal_gap = int(im0.shape[1] * 0.02) |
|
|
@ -836,8 +836,8 @@ class Annotator: |
|
|
|
Args: |
|
|
|
Args: |
|
|
|
pixels_distance (float): Pixels distance between two bbox centroids. |
|
|
|
pixels_distance (float): Pixels distance between two bbox centroids. |
|
|
|
centroids (list): Bounding box centroids data. |
|
|
|
centroids (list): Bounding box centroids data. |
|
|
|
line_color (RGB): Distance line color. |
|
|
|
line_color (tuple): RGB distance line color. |
|
|
|
centroid_color (RGB): Bounding box centroid color. |
|
|
|
centroid_color (tuple): RGB bounding box centroid color. |
|
|
|
""" |
|
|
|
""" |
|
|
|
# Get the text size |
|
|
|
# Get the text size |
|
|
|
(text_width_m, text_height_m), _ = cv2.getTextSize( |
|
|
|
(text_width_m, text_height_m), _ = cv2.getTextSize( |
|
|
|