ultralytics 8.3.87__py3-none-any.whl → 8.3.88__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tests/test_solutions.py +34 -45
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/__init__.py +46 -39
- ultralytics/data/augment.py +2 -2
- ultralytics/solutions/__init__.py +14 -6
- ultralytics/solutions/ai_gym.py +39 -28
- ultralytics/solutions/analytics.py +22 -18
- ultralytics/solutions/distance_calculation.py +25 -25
- ultralytics/solutions/heatmap.py +40 -38
- ultralytics/solutions/instance_segmentation.py +69 -0
- ultralytics/solutions/object_blurrer.py +89 -0
- ultralytics/solutions/object_counter.py +35 -33
- ultralytics/solutions/object_cropper.py +84 -0
- ultralytics/solutions/parking_management.py +21 -9
- ultralytics/solutions/queue_management.py +20 -39
- ultralytics/solutions/region_counter.py +54 -51
- ultralytics/solutions/security_alarm.py +40 -30
- ultralytics/solutions/solutions.py +594 -16
- ultralytics/solutions/speed_estimation.py +34 -31
- ultralytics/solutions/streamlit_inference.py +34 -28
- ultralytics/solutions/trackzone.py +29 -18
- ultralytics/solutions/vision_eye.py +69 -0
- ultralytics/trackers/utils/kalman_filter.py +23 -23
- ultralytics/utils/instance.py +3 -3
- ultralytics/utils/plotting.py +0 -414
- {ultralytics-8.3.87.dist-info → ultralytics-8.3.88.dist-info}/METADATA +1 -1
- {ultralytics-8.3.87.dist-info → ultralytics-8.3.88.dist-info}/RECORD +31 -27
- {ultralytics-8.3.87.dist-info → ultralytics-8.3.88.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.87.dist-info → ultralytics-8.3.88.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.87.dist-info → ultralytics-8.3.88.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.87.dist-info → ultralytics-8.3.88.dist-info}/top_level.txt +0 -0
ultralytics/utils/plotting.py
CHANGED
@@ -271,84 +271,6 @@ class Annotator:
|
|
271
271
|
else:
|
272
272
|
return txt_color
|
273
273
|
|
274
|
-
def circle_label(self, box, label="", color=(128, 128, 128), txt_color=(255, 255, 255), margin=2):
|
275
|
-
"""
|
276
|
-
Draws a label with a background circle centered within a given bounding box.
|
277
|
-
|
278
|
-
Args:
|
279
|
-
box (tuple): The bounding box coordinates (x1, y1, x2, y2).
|
280
|
-
label (str): The text label to be displayed.
|
281
|
-
color (tuple, optional): The background color of the rectangle (B, G, R).
|
282
|
-
txt_color (tuple, optional): The color of the text (R, G, B).
|
283
|
-
margin (int, optional): The margin between the text and the rectangle border.
|
284
|
-
"""
|
285
|
-
# If label have more than 3 characters, skip other characters, due to circle size
|
286
|
-
if len(label) > 3:
|
287
|
-
print(
|
288
|
-
f"Length of label is {len(label)}, initial 3 label characters will be considered for circle annotation!"
|
289
|
-
)
|
290
|
-
label = label[:3]
|
291
|
-
|
292
|
-
# Calculate the center of the box
|
293
|
-
x_center, y_center = int((box[0] + box[2]) / 2), int((box[1] + box[3]) / 2)
|
294
|
-
# Get the text size
|
295
|
-
text_size = cv2.getTextSize(str(label), cv2.FONT_HERSHEY_SIMPLEX, self.sf - 0.15, self.tf)[0]
|
296
|
-
# Calculate the required radius to fit the text with the margin
|
297
|
-
required_radius = int(((text_size[0] ** 2 + text_size[1] ** 2) ** 0.5) / 2) + margin
|
298
|
-
# Draw the circle with the required radius
|
299
|
-
cv2.circle(self.im, (x_center, y_center), required_radius, color, -1)
|
300
|
-
# Calculate the position for the text
|
301
|
-
text_x = x_center - text_size[0] // 2
|
302
|
-
text_y = y_center + text_size[1] // 2
|
303
|
-
# Draw the text
|
304
|
-
cv2.putText(
|
305
|
-
self.im,
|
306
|
-
str(label),
|
307
|
-
(text_x, text_y),
|
308
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
309
|
-
self.sf - 0.15,
|
310
|
-
self.get_txt_color(color, txt_color),
|
311
|
-
self.tf,
|
312
|
-
lineType=cv2.LINE_AA,
|
313
|
-
)
|
314
|
-
|
315
|
-
def text_label(self, box, label="", color=(128, 128, 128), txt_color=(255, 255, 255), margin=5):
|
316
|
-
"""
|
317
|
-
Draws a label with a background rectangle centered within a given bounding box.
|
318
|
-
|
319
|
-
Args:
|
320
|
-
box (tuple): The bounding box coordinates (x1, y1, x2, y2).
|
321
|
-
label (str): The text label to be displayed.
|
322
|
-
color (tuple, optional): The background color of the rectangle (B, G, R).
|
323
|
-
txt_color (tuple, optional): The color of the text (R, G, B).
|
324
|
-
margin (int, optional): The margin between the text and the rectangle border.
|
325
|
-
"""
|
326
|
-
# Calculate the center of the bounding box
|
327
|
-
x_center, y_center = int((box[0] + box[2]) / 2), int((box[1] + box[3]) / 2)
|
328
|
-
# Get the size of the text
|
329
|
-
text_size = cv2.getTextSize(label, cv2.FONT_HERSHEY_SIMPLEX, self.sf - 0.1, self.tf)[0]
|
330
|
-
# Calculate the top-left corner of the text (to center it)
|
331
|
-
text_x = x_center - text_size[0] // 2
|
332
|
-
text_y = y_center + text_size[1] // 2
|
333
|
-
# Calculate the coordinates of the background rectangle
|
334
|
-
rect_x1 = text_x - margin
|
335
|
-
rect_y1 = text_y - text_size[1] - margin
|
336
|
-
rect_x2 = text_x + text_size[0] + margin
|
337
|
-
rect_y2 = text_y + margin
|
338
|
-
# Draw the background rectangle
|
339
|
-
cv2.rectangle(self.im, (rect_x1, rect_y1), (rect_x2, rect_y2), color, -1)
|
340
|
-
# Draw the text on top of the rectangle
|
341
|
-
cv2.putText(
|
342
|
-
self.im,
|
343
|
-
label,
|
344
|
-
(text_x, text_y),
|
345
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
346
|
-
self.sf - 0.1,
|
347
|
-
self.get_txt_color(color, txt_color),
|
348
|
-
self.tf,
|
349
|
-
lineType=cv2.LINE_AA,
|
350
|
-
)
|
351
|
-
|
352
274
|
def box_label(self, box, label="", color=(128, 128, 128), txt_color=(255, 255, 255), rotated=False):
|
353
275
|
"""
|
354
276
|
Draws a bounding box to image with label.
|
@@ -591,342 +513,6 @@ class Annotator:
|
|
591
513
|
height = y_max - y_min
|
592
514
|
return width, height, width * height
|
593
515
|
|
594
|
-
def draw_region(self, reg_pts=None, color=(0, 255, 0), thickness=5):
|
595
|
-
"""
|
596
|
-
Draw region line.
|
597
|
-
|
598
|
-
Args:
|
599
|
-
reg_pts (list): Region Points (for line 2 points, for region 4 points)
|
600
|
-
color (tuple): Region Color value
|
601
|
-
thickness (int): Region area thickness value
|
602
|
-
"""
|
603
|
-
cv2.polylines(self.im, [np.array(reg_pts, dtype=np.int32)], isClosed=True, color=color, thickness=thickness)
|
604
|
-
|
605
|
-
# Draw small circles at the corner points
|
606
|
-
for point in reg_pts:
|
607
|
-
cv2.circle(self.im, (point[0], point[1]), thickness * 2, color, -1) # -1 fills the circle
|
608
|
-
|
609
|
-
def draw_centroid_and_tracks(self, track, color=(255, 0, 255), track_thickness=2):
|
610
|
-
"""
|
611
|
-
Draw centroid point and track trails.
|
612
|
-
|
613
|
-
Args:
|
614
|
-
track (list): object tracking points for trails display
|
615
|
-
color (tuple): tracks line color
|
616
|
-
track_thickness (int): track line thickness value
|
617
|
-
"""
|
618
|
-
points = np.hstack(track).astype(np.int32).reshape((-1, 1, 2))
|
619
|
-
cv2.polylines(self.im, [points], isClosed=False, color=color, thickness=track_thickness)
|
620
|
-
cv2.circle(self.im, (int(track[-1][0]), int(track[-1][1])), track_thickness * 2, color, -1)
|
621
|
-
|
622
|
-
def queue_counts_display(self, label, points=None, region_color=(255, 255, 255), txt_color=(0, 0, 0)):
|
623
|
-
"""
|
624
|
-
Displays queue counts on an image centered at the points with customizable font size and colors.
|
625
|
-
|
626
|
-
Args:
|
627
|
-
label (str): Queue counts label.
|
628
|
-
points (tuple): Region points for center point calculation to display text.
|
629
|
-
region_color (tuple): RGB queue region color.
|
630
|
-
txt_color (tuple): RGB text display color.
|
631
|
-
"""
|
632
|
-
x_values = [point[0] for point in points]
|
633
|
-
y_values = [point[1] for point in points]
|
634
|
-
center_x = sum(x_values) // len(points)
|
635
|
-
center_y = sum(y_values) // len(points)
|
636
|
-
|
637
|
-
text_size = cv2.getTextSize(label, 0, fontScale=self.sf, thickness=self.tf)[0]
|
638
|
-
text_width = text_size[0]
|
639
|
-
text_height = text_size[1]
|
640
|
-
|
641
|
-
rect_width = text_width + 20
|
642
|
-
rect_height = text_height + 20
|
643
|
-
rect_top_left = (center_x - rect_width // 2, center_y - rect_height // 2)
|
644
|
-
rect_bottom_right = (center_x + rect_width // 2, center_y + rect_height // 2)
|
645
|
-
cv2.rectangle(self.im, rect_top_left, rect_bottom_right, region_color, -1)
|
646
|
-
|
647
|
-
text_x = center_x - text_width // 2
|
648
|
-
text_y = center_y + text_height // 2
|
649
|
-
|
650
|
-
# Draw text
|
651
|
-
cv2.putText(
|
652
|
-
self.im,
|
653
|
-
label,
|
654
|
-
(text_x, text_y),
|
655
|
-
0,
|
656
|
-
fontScale=self.sf,
|
657
|
-
color=txt_color,
|
658
|
-
thickness=self.tf,
|
659
|
-
lineType=cv2.LINE_AA,
|
660
|
-
)
|
661
|
-
|
662
|
-
def display_objects_labels(self, im0, text, txt_color, bg_color, x_center, y_center, margin):
|
663
|
-
"""
|
664
|
-
Display the bounding boxes labels in parking management app.
|
665
|
-
|
666
|
-
Args:
|
667
|
-
im0 (ndarray): Inference image.
|
668
|
-
text (str): Object/class name.
|
669
|
-
txt_color (tuple): Display color for text foreground.
|
670
|
-
bg_color (tuple): Display color for text background.
|
671
|
-
x_center (float): The x position center point for bounding box.
|
672
|
-
y_center (float): The y position center point for bounding box.
|
673
|
-
margin (int): The gap between text and rectangle for better display.
|
674
|
-
"""
|
675
|
-
text_size = cv2.getTextSize(text, 0, fontScale=self.sf, thickness=self.tf)[0]
|
676
|
-
text_x = x_center - text_size[0] // 2
|
677
|
-
text_y = y_center + text_size[1] // 2
|
678
|
-
|
679
|
-
rect_x1 = text_x - margin
|
680
|
-
rect_y1 = text_y - text_size[1] - margin
|
681
|
-
rect_x2 = text_x + text_size[0] + margin
|
682
|
-
rect_y2 = text_y + margin
|
683
|
-
cv2.rectangle(im0, (rect_x1, rect_y1), (rect_x2, rect_y2), bg_color, -1)
|
684
|
-
cv2.putText(im0, text, (text_x, text_y), 0, self.sf, txt_color, self.tf, lineType=cv2.LINE_AA)
|
685
|
-
|
686
|
-
def display_analytics(self, im0, text, txt_color, bg_color, margin):
|
687
|
-
"""
|
688
|
-
Display the overall statistics for parking lots.
|
689
|
-
|
690
|
-
Args:
|
691
|
-
im0 (ndarray): Inference image.
|
692
|
-
text (dict): Labels dictionary.
|
693
|
-
txt_color (tuple): Display color for text foreground.
|
694
|
-
bg_color (tuple): Display color for text background.
|
695
|
-
margin (int): Gap between text and rectangle for better display.
|
696
|
-
"""
|
697
|
-
horizontal_gap = int(im0.shape[1] * 0.02)
|
698
|
-
vertical_gap = int(im0.shape[0] * 0.01)
|
699
|
-
text_y_offset = 0
|
700
|
-
for label, value in text.items():
|
701
|
-
txt = f"{label}: {value}"
|
702
|
-
text_size = cv2.getTextSize(txt, 0, self.sf, self.tf)[0]
|
703
|
-
if text_size[0] < 5 or text_size[1] < 5:
|
704
|
-
text_size = (5, 5)
|
705
|
-
text_x = im0.shape[1] - text_size[0] - margin * 2 - horizontal_gap
|
706
|
-
text_y = text_y_offset + text_size[1] + margin * 2 + vertical_gap
|
707
|
-
rect_x1 = text_x - margin * 2
|
708
|
-
rect_y1 = text_y - text_size[1] - margin * 2
|
709
|
-
rect_x2 = text_x + text_size[0] + margin * 2
|
710
|
-
rect_y2 = text_y + margin * 2
|
711
|
-
cv2.rectangle(im0, (rect_x1, rect_y1), (rect_x2, rect_y2), bg_color, -1)
|
712
|
-
cv2.putText(im0, txt, (text_x, text_y), 0, self.sf, txt_color, self.tf, lineType=cv2.LINE_AA)
|
713
|
-
text_y_offset = rect_y2
|
714
|
-
|
715
|
-
@staticmethod
|
716
|
-
def estimate_pose_angle(a, b, c):
|
717
|
-
"""
|
718
|
-
Calculate the pose angle for object.
|
719
|
-
|
720
|
-
Args:
|
721
|
-
a (float) : The value of pose point a
|
722
|
-
b (float): The value of pose point b
|
723
|
-
c (float): The value o pose point c
|
724
|
-
|
725
|
-
Returns:
|
726
|
-
angle (degree): Degree value of angle between three points
|
727
|
-
"""
|
728
|
-
a, b, c = np.array(a), np.array(b), np.array(c)
|
729
|
-
radians = np.arctan2(c[1] - b[1], c[0] - b[0]) - np.arctan2(a[1] - b[1], a[0] - b[0])
|
730
|
-
angle = np.abs(radians * 180.0 / np.pi)
|
731
|
-
if angle > 180.0:
|
732
|
-
angle = 360 - angle
|
733
|
-
return angle
|
734
|
-
|
735
|
-
def draw_specific_points(self, keypoints, indices=None, radius=2, conf_thres=0.25):
|
736
|
-
"""
|
737
|
-
Draw specific keypoints for gym steps counting.
|
738
|
-
|
739
|
-
Args:
|
740
|
-
keypoints (list): Keypoints data to be plotted.
|
741
|
-
indices (list, optional): Keypoint indices to be plotted. Defaults to [2, 5, 7].
|
742
|
-
radius (int, optional): Keypoint radius. Defaults to 2.
|
743
|
-
conf_thres (float, optional): Confidence threshold for keypoints. Defaults to 0.25.
|
744
|
-
|
745
|
-
Returns:
|
746
|
-
(numpy.ndarray): Image with drawn keypoints.
|
747
|
-
|
748
|
-
Note:
|
749
|
-
Keypoint format: [x, y] or [x, y, confidence].
|
750
|
-
Modifies self.im in-place.
|
751
|
-
"""
|
752
|
-
indices = indices or [2, 5, 7]
|
753
|
-
points = [(int(k[0]), int(k[1])) for i, k in enumerate(keypoints) if i in indices and k[2] >= conf_thres]
|
754
|
-
|
755
|
-
# Draw lines between consecutive points
|
756
|
-
for start, end in zip(points[:-1], points[1:]):
|
757
|
-
cv2.line(self.im, start, end, (0, 255, 0), 2, lineType=cv2.LINE_AA)
|
758
|
-
|
759
|
-
# Draw circles for keypoints
|
760
|
-
for pt in points:
|
761
|
-
cv2.circle(self.im, pt, radius, (0, 0, 255), -1, lineType=cv2.LINE_AA)
|
762
|
-
|
763
|
-
return self.im
|
764
|
-
|
765
|
-
def plot_workout_information(self, display_text, position, color=(104, 31, 17), txt_color=(255, 255, 255)):
|
766
|
-
"""
|
767
|
-
Draw text with a background on the image.
|
768
|
-
|
769
|
-
Args:
|
770
|
-
display_text (str): The text to be displayed.
|
771
|
-
position (tuple): Coordinates (x, y) on the image where the text will be placed.
|
772
|
-
color (tuple, optional): Text background color
|
773
|
-
txt_color (tuple, optional): Text foreground color
|
774
|
-
"""
|
775
|
-
(text_width, text_height), _ = cv2.getTextSize(display_text, 0, self.sf, self.tf)
|
776
|
-
|
777
|
-
# Draw background rectangle
|
778
|
-
cv2.rectangle(
|
779
|
-
self.im,
|
780
|
-
(position[0], position[1] - text_height - 5),
|
781
|
-
(position[0] + text_width + 10, position[1] - text_height - 5 + text_height + 10 + self.tf),
|
782
|
-
color,
|
783
|
-
-1,
|
784
|
-
)
|
785
|
-
# Draw text
|
786
|
-
cv2.putText(self.im, display_text, position, 0, self.sf, txt_color, self.tf)
|
787
|
-
|
788
|
-
return text_height
|
789
|
-
|
790
|
-
def plot_angle_and_count_and_stage(
|
791
|
-
self, angle_text, count_text, stage_text, center_kpt, color=(104, 31, 17), txt_color=(255, 255, 255)
|
792
|
-
):
|
793
|
-
"""
|
794
|
-
Plot the pose angle, count value, and step stage.
|
795
|
-
|
796
|
-
Args:
|
797
|
-
angle_text (str): Angle value for workout monitoring
|
798
|
-
count_text (str): Counts value for workout monitoring
|
799
|
-
stage_text (str): Stage decision for workout monitoring
|
800
|
-
center_kpt (list): Centroid pose index for workout monitoring
|
801
|
-
color (tuple, optional): Text background color
|
802
|
-
txt_color (tuple, optional): Text foreground color
|
803
|
-
"""
|
804
|
-
# Format text
|
805
|
-
angle_text, count_text, stage_text = f" {angle_text:.2f}", f"Steps : {count_text}", f" {stage_text}"
|
806
|
-
|
807
|
-
# Draw angle, count and stage text
|
808
|
-
angle_height = self.plot_workout_information(
|
809
|
-
angle_text, (int(center_kpt[0]), int(center_kpt[1])), color, txt_color
|
810
|
-
)
|
811
|
-
count_height = self.plot_workout_information(
|
812
|
-
count_text, (int(center_kpt[0]), int(center_kpt[1]) + angle_height + 20), color, txt_color
|
813
|
-
)
|
814
|
-
self.plot_workout_information(
|
815
|
-
stage_text, (int(center_kpt[0]), int(center_kpt[1]) + angle_height + count_height + 40), color, txt_color
|
816
|
-
)
|
817
|
-
|
818
|
-
def seg_bbox(self, mask, mask_color=(255, 0, 255), label=None, txt_color=(255, 255, 255)):
|
819
|
-
"""
|
820
|
-
Function for drawing segmented object in bounding box shape.
|
821
|
-
|
822
|
-
Args:
|
823
|
-
mask (np.ndarray): A 2D array of shape (N, 2) containing the contour points of the segmented object.
|
824
|
-
mask_color (tuple): RGB color for the contour and label background.
|
825
|
-
label (str, optional): Text label for the object. If None, no label is drawn.
|
826
|
-
txt_color (tuple): RGB color for the label text.
|
827
|
-
"""
|
828
|
-
if mask.size == 0: # no masks to plot
|
829
|
-
return
|
830
|
-
|
831
|
-
cv2.polylines(self.im, [np.int32([mask])], isClosed=True, color=mask_color, thickness=2)
|
832
|
-
if label:
|
833
|
-
text_size, _ = cv2.getTextSize(label, 0, self.sf, self.tf)
|
834
|
-
cv2.rectangle(
|
835
|
-
self.im,
|
836
|
-
(int(mask[0][0]) - text_size[0] // 2 - 10, int(mask[0][1]) - text_size[1] - 10),
|
837
|
-
(int(mask[0][0]) + text_size[0] // 2 + 10, int(mask[0][1] + 10)),
|
838
|
-
mask_color,
|
839
|
-
-1,
|
840
|
-
)
|
841
|
-
cv2.putText(
|
842
|
-
self.im, label, (int(mask[0][0]) - text_size[0] // 2, int(mask[0][1])), 0, self.sf, txt_color, self.tf
|
843
|
-
)
|
844
|
-
|
845
|
-
def sweep_annotator(self, line_x=0, line_y=0, label=None, color=(221, 0, 186), txt_color=(255, 255, 255)):
|
846
|
-
"""
|
847
|
-
Function for drawing a sweep annotation line and an optional label.
|
848
|
-
|
849
|
-
Args:
|
850
|
-
line_x (int): The x-coordinate of the sweep line.
|
851
|
-
line_y (int): The y-coordinate limit of the sweep line.
|
852
|
-
label (str, optional): Text label to be drawn in center of sweep line. If None, no label is drawn.
|
853
|
-
color (tuple): RGB color for the line and label background.
|
854
|
-
txt_color (tuple): RGB color for the label text.
|
855
|
-
"""
|
856
|
-
# Draw the sweep line
|
857
|
-
cv2.line(self.im, (line_x, 0), (line_x, line_y), color, self.tf * 2)
|
858
|
-
|
859
|
-
# Draw label, if provided
|
860
|
-
if label:
|
861
|
-
(text_width, text_height), _ = cv2.getTextSize(label, cv2.FONT_HERSHEY_SIMPLEX, self.sf, self.tf)
|
862
|
-
cv2.rectangle(
|
863
|
-
self.im,
|
864
|
-
(line_x - text_width // 2 - 10, line_y // 2 - text_height // 2 - 10),
|
865
|
-
(line_x + text_width // 2 + 10, line_y // 2 + text_height // 2 + 10),
|
866
|
-
color,
|
867
|
-
-1,
|
868
|
-
)
|
869
|
-
cv2.putText(
|
870
|
-
self.im,
|
871
|
-
label,
|
872
|
-
(line_x - text_width // 2, line_y // 2 + text_height // 2),
|
873
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
874
|
-
self.sf,
|
875
|
-
txt_color,
|
876
|
-
self.tf,
|
877
|
-
)
|
878
|
-
|
879
|
-
def plot_distance_and_line(
|
880
|
-
self, pixels_distance, centroids, line_color=(104, 31, 17), centroid_color=(255, 0, 255)
|
881
|
-
):
|
882
|
-
"""
|
883
|
-
Plot the distance and line on frame.
|
884
|
-
|
885
|
-
Args:
|
886
|
-
pixels_distance (float): Pixels distance between two bbox centroids.
|
887
|
-
centroids (list): Bounding box centroids data.
|
888
|
-
line_color (tuple, optional): Distance line color.
|
889
|
-
centroid_color (tuple, optional): Bounding box centroid color.
|
890
|
-
"""
|
891
|
-
# Get the text size
|
892
|
-
text = f"Pixels Distance: {pixels_distance:.2f}"
|
893
|
-
(text_width_m, text_height_m), _ = cv2.getTextSize(text, 0, self.sf, self.tf)
|
894
|
-
|
895
|
-
# Define corners with 10-pixel margin and draw rectangle
|
896
|
-
cv2.rectangle(self.im, (15, 25), (15 + text_width_m + 20, 25 + text_height_m + 20), line_color, -1)
|
897
|
-
|
898
|
-
# Calculate the position for the text with a 10-pixel margin and draw text
|
899
|
-
text_position = (25, 25 + text_height_m + 10)
|
900
|
-
cv2.putText(
|
901
|
-
self.im,
|
902
|
-
text,
|
903
|
-
text_position,
|
904
|
-
0,
|
905
|
-
self.sf,
|
906
|
-
(255, 255, 255),
|
907
|
-
self.tf,
|
908
|
-
cv2.LINE_AA,
|
909
|
-
)
|
910
|
-
|
911
|
-
cv2.line(self.im, centroids[0], centroids[1], line_color, 3)
|
912
|
-
cv2.circle(self.im, centroids[0], 6, centroid_color, -1)
|
913
|
-
cv2.circle(self.im, centroids[1], 6, centroid_color, -1)
|
914
|
-
|
915
|
-
def visioneye(self, box, center_point, color=(235, 219, 11), pin_color=(255, 0, 255)):
|
916
|
-
"""
|
917
|
-
Function for pinpoint human-vision eye mapping and plotting.
|
918
|
-
|
919
|
-
Args:
|
920
|
-
box (list): Bounding box coordinates
|
921
|
-
center_point (tuple): center point for vision eye view
|
922
|
-
color (tuple): object centroid and line color value
|
923
|
-
pin_color (tuple): visioneye point color value
|
924
|
-
"""
|
925
|
-
center_bbox = int((box[0] + box[2]) / 2), int((box[1] + box[3]) / 2)
|
926
|
-
cv2.circle(self.im, center_point, self.tf * 2, pin_color, -1)
|
927
|
-
cv2.circle(self.im, center_bbox, self.tf * 2, color, -1)
|
928
|
-
cv2.line(self.im, center_point, center_bbox, color, self.tf)
|
929
|
-
|
930
516
|
|
931
517
|
@TryExcept() # known issue https://github.com/ultralytics/yolov5/issues/5395
|
932
518
|
@plt_settings()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.88
|
4
4
|
Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -6,11 +6,11 @@ tests/test_engine.py,sha256=aGqZ8P7QO5C_nOa1b4FOyk92Ysdk5WiP-ST310Vyxys,4962
|
|
6
6
|
tests/test_exports.py,sha256=dpUT_FXFXzFoItfZwbxkPFXgEfaVqyfYwkIQW4teL38,9223
|
7
7
|
tests/test_integrations.py,sha256=p3DMnnPMKsV0Qm82JVJUIY1UZ67xRgF9E8AaL76TEHE,6154
|
8
8
|
tests/test_python.py,sha256=tW-EFJC2rjl_DvAa8khXGWYdypseQjrLjGHhe2p9r9A,23238
|
9
|
-
tests/test_solutions.py,sha256=
|
10
|
-
ultralytics/__init__.py,sha256=
|
9
|
+
tests/test_solutions.py,sha256=s7f0t8YTkR7oLF9YkEEAHj1DjqZ-Rgj0hMNC1v8CkCY,5111
|
10
|
+
ultralytics/__init__.py,sha256=Y3Bo3zwPtYrJj4cEUqII9s_5sZ3yeeU3sbA6-f2sxMg,709
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
13
|
-
ultralytics/cfg/__init__.py,sha256=
|
13
|
+
ultralytics/cfg/__init__.py,sha256=Bh0McMrE8fwelWLRWiUHmkesrPXNQBDBvJxQSd_5Lt4,39811
|
14
14
|
ultralytics/cfg/default.yaml,sha256=tHE_VB_tzq5K1BntCCukmFIViwiRv0R-H6ZNucCnYsY,8469
|
15
15
|
ultralytics/cfg/datasets/Argoverse.yaml,sha256=_xlEDIJ9XkUo0v_iNL7FW079BoSeZtKSuLteKTtGbA8,3275
|
16
16
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=SHND_CFkojxw5iQD5Mcgju2kCZIl0gW2ajuzv1cqoL0,1224
|
@@ -98,7 +98,7 @@ ultralytics/cfg/trackers/botsort.yaml,sha256=D9doE5GQUe6HrAFzr7OfQFIGPFk0M_vJ0B_
|
|
98
98
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=6u-tiZlk16EqEwkNXaMrza6PAQmWj_ypgv26LGCtPDg,886
|
99
99
|
ultralytics/data/__init__.py,sha256=nAXaL1puCc7z_NjzQNlJnhbVhT9Fla2u7Dsqo7q1dAc,644
|
100
100
|
ultralytics/data/annotator.py,sha256=88Qf4CPhmmKJi99VQiKNrLQMP4kPAX799_iftScfh2g,3085
|
101
|
-
ultralytics/data/augment.py,sha256=
|
101
|
+
ultralytics/data/augment.py,sha256=wlAbsWqmDIfSB4Ys4iN354FTTnH7SmHueUH19j7JpF4,120963
|
102
102
|
ultralytics/data/base.py,sha256=JBmVrbrbvk0ImFVCMj3mDQ1GPY0PHak0LEFfw79iIX0,15214
|
103
103
|
ultralytics/data/build.py,sha256=gOU5SNABBNxwo5012N--WhjEnLK2ewycXIryMpbHg6U,7685
|
104
104
|
ultralytics/data/converter.py,sha256=tKPTtleDkDfPO0XbisQfa7SBwyTL4Sx19k2sZDWu3S4,24552
|
@@ -186,20 +186,24 @@ ultralytics/nn/modules/conv.py,sha256=Wx_tZ56M7iMiNqz3v03oi86C2fatdmdBBDpkrUyzEI
|
|
186
186
|
ultralytics/nn/modules/head.py,sha256=RYT31wplr64yDSHLpEZy3fyqg9W8HWlXWKrltwpqGiQ,27962
|
187
187
|
ultralytics/nn/modules/transformer.py,sha256=fdc4xam82Dk8etahkhlc5RHW6dfY00klKj2od4QpdQo,18097
|
188
188
|
ultralytics/nn/modules/utils.py,sha256=AA2M6ZyBgmnMXUuiqJ5aSpQv2h1BmmcWuBVA1343nZg,3223
|
189
|
-
ultralytics/solutions/__init__.py,sha256=
|
190
|
-
ultralytics/solutions/ai_gym.py,sha256=
|
191
|
-
ultralytics/solutions/analytics.py,sha256=
|
192
|
-
ultralytics/solutions/distance_calculation.py,sha256=
|
193
|
-
ultralytics/solutions/heatmap.py,sha256=
|
194
|
-
ultralytics/solutions/
|
195
|
-
ultralytics/solutions/
|
196
|
-
ultralytics/solutions/
|
197
|
-
ultralytics/solutions/
|
198
|
-
ultralytics/solutions/
|
199
|
-
ultralytics/solutions/
|
200
|
-
ultralytics/solutions/
|
201
|
-
ultralytics/solutions/
|
202
|
-
ultralytics/solutions/
|
189
|
+
ultralytics/solutions/__init__.py,sha256=pjNYva0qnw-4hf_tTLx_dgIfg24XrYLLp3kygPj95rs,1113
|
190
|
+
ultralytics/solutions/ai_gym.py,sha256=NLuie0J_SFJzu3cxltenPP0bD2KMvbXCKobJ9lawmuY,5704
|
191
|
+
ultralytics/solutions/analytics.py,sha256=_WzoBWkpS6_xANlAXSc0ePzT3aJCYJpl3Nn-rM0ujy4,11991
|
192
|
+
ultralytics/solutions/distance_calculation.py,sha256=n6bPNJ7YbPKAaHWsra6CQQtrDR0SEvSC14BRWTITyBU,5711
|
193
|
+
ultralytics/solutions/heatmap.py,sha256=tewwXsFt8yumQgWdhirTjz70h39vrSxXxPsALBQF2QA,5633
|
194
|
+
ultralytics/solutions/instance_segmentation.py,sha256=pRRVkNgTFz3imOzGBJIuzFHP8ue9deyRXN96rEZQYpE,2823
|
195
|
+
ultralytics/solutions/object_blurrer.py,sha256=Jm6m-h9adloUfhFWvLV_ph4T-7afr3CchdhS1LOR-4k,3899
|
196
|
+
ultralytics/solutions/object_counter.py,sha256=uAspx90vi6W0SX11E1BEgWOATBEK5YZN60fvS7UFITk,9885
|
197
|
+
ultralytics/solutions/object_cropper.py,sha256=5IawDE8THfkTcN3aYr9HsG6YWfeD9erTeZnT6C1YXoA,3389
|
198
|
+
ultralytics/solutions/parking_management.py,sha256=-V7jtrvOSS0tn0yqj9vt76whAKZz3W8Qab6nCJ9JldA,13306
|
199
|
+
ultralytics/solutions/queue_management.py,sha256=MTVbiElt8fgKbEfJv33sFLQGFcJZa7JRz3OSy9gj2mc,4310
|
200
|
+
ultralytics/solutions/region_counter.py,sha256=kzMI17__1jt-qlYYaiwLKuPb6gdxWXe3VkdgWhi7zkc,5302
|
201
|
+
ultralytics/solutions/security_alarm.py,sha256=3YrpIYTn2ujuRhe1jolqO2BuwrUSOMDMfcnADiY8g0c,6267
|
202
|
+
ultralytics/solutions/solutions.py,sha256=xHHPQznZGUwf0AzBa_BBhW0ORZnC7SR6iSGCpDvbm6U,33615
|
203
|
+
ultralytics/solutions/speed_estimation.py,sha256=VCuwgrEO4kXP8y-_NnDPC0f60p84fMoBf0UhtOh7GgE,5152
|
204
|
+
ultralytics/solutions/streamlit_inference.py,sha256=C1lRnRXSMCdPrmpMNoz8-o8pbXNcyu97JcHuxYMFDrs,9858
|
205
|
+
ultralytics/solutions/trackzone.py,sha256=a0JK7a7LhN1jgQ3wF8yBVcZxMgqOh9opBX-cUEP5Bpo,3286
|
206
|
+
ultralytics/solutions/vision_eye.py,sha256=9x4HqfGvsOJ6Dz7cCOYJvk7O2YzGh-SiS0-lzhyF6Yw,2942
|
203
207
|
ultralytics/trackers/__init__.py,sha256=Zlu_Ig5osn7hqch_g5Be_e4pwZUkeeTQiesJCi0pFGI,255
|
204
208
|
ultralytics/trackers/basetrack.py,sha256=h0fcxzCdZf_56H1NG_mCIATaz_cWj0e9aJKE1xgmtFQ,4451
|
205
209
|
ultralytics/trackers/bot_sort.py,sha256=xUmlj0agS0PGjy97N3C0jLMV07yvsurE5QcnuoV_Ecw,10522
|
@@ -207,7 +211,7 @@ ultralytics/trackers/byte_tracker.py,sha256=CT_Yjw2ahHoprEfNcTM0hBMoGss5qcqt6Pax
|
|
207
211
|
ultralytics/trackers/track.py,sha256=PtGB4CTMdylvccrzho37nysMvVS8gSINGFgZY0n-AuU,3973
|
208
212
|
ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
209
213
|
ultralytics/trackers/utils/gmc.py,sha256=kU54RozuGJcAVlyb5_HjXiNIUIX5VuH613AMc6Gdnwg,14597
|
210
|
-
ultralytics/trackers/utils/kalman_filter.py,sha256=
|
214
|
+
ultralytics/trackers/utils/kalman_filter.py,sha256=zjpdKs4AZ8UQxmouQEaibFk9y5LX_f7199AFSXbr96k,21446
|
211
215
|
ultralytics/trackers/utils/matching.py,sha256=64PKHGoETwXhuZ9udE217hbjJHygLOPaYA66J2qMSno,7130
|
212
216
|
ultralytics/utils/__init__.py,sha256=p3-iu1q2mzeKGjb4S2aSx3QmSgv6cDT3rEf1RvHEwZM,49941
|
213
217
|
ultralytics/utils/autobatch.py,sha256=zc81HlAMArPASEbExty0E_zpITF8PVwin7w-xBFFZ5w,5048
|
@@ -217,12 +221,12 @@ ultralytics/utils/dist.py,sha256=fuiJQEnyyL-SighlI3hUlZPaaSreUl4Q39snF6OhQtI,238
|
|
217
221
|
ultralytics/utils/downloads.py,sha256=5B1uwRr6Urb5ShZAAni5_tq9a-3o0fSAH3xNCULktFY,22100
|
218
222
|
ultralytics/utils/errors.py,sha256=sXKDEd8ws3L-yIfG_-P_h86axbm37sJNha7kFBJbQMQ,844
|
219
223
|
ultralytics/utils/files.py,sha256=c85NRofjGPMcpkV-yUo1Cwk8ZVquBGCEKlzbSVtXkQA,8252
|
220
|
-
ultralytics/utils/instance.py,sha256=
|
224
|
+
ultralytics/utils/instance.py,sha256=OFXZAxqBU-LC3aufVolmjEKB1UxZQb8KDAaMWyXbeh8,16896
|
221
225
|
ultralytics/utils/loss.py,sha256=rL_jUOxcxL7kPTJKVLQsgwsJybnPbtDAE8FzftcOAHs,34188
|
222
226
|
ultralytics/utils/metrics.py,sha256=6VfTtPzPppuX2RfXr84GoI_ABPfHPhXbbMKkH2HvUVc,53672
|
223
227
|
ultralytics/utils/ops.py,sha256=e7HNeufSrOnaHaie8w-QHNnyaClcHuiGZvr3CXRABsU,34621
|
224
228
|
ultralytics/utils/patches.py,sha256=ARR89dP4YKq7Dd3g2eU-ukbnc2lo3BELukL_1c_d854,3298
|
225
|
-
ultralytics/utils/plotting.py,sha256=
|
229
|
+
ultralytics/utils/plotting.py,sha256=Vbv_AZGw0rPydcZG9VDfzrqJW9NGb2k1nOJA7SnxNUM,46200
|
226
230
|
ultralytics/utils/tal.py,sha256=DO-c006HEI62pcrNRpmt4lpqJPC5yu3veRDOvUuExno,18498
|
227
231
|
ultralytics/utils/torch_utils.py,sha256=h1aWTJ71NX5Q_L5ZAj-4Yljht5S_6YEhE2XUm2Apt2M,34039
|
228
232
|
ultralytics/utils/triton.py,sha256=2L1_rZ8xCJEjexRVj75g9YU-u4tQln_DJ5N1Yr_0bSs,4071
|
@@ -238,9 +242,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=waZ_bRu0-qBKujTLuqonC2gx2DkgBuVnfq
|
|
238
242
|
ultralytics/utils/callbacks/raytune.py,sha256=A_NVWjyPNf2m6iB-mbW7SMpyqM9QBvpbPa-MCMFMtdk,727
|
239
243
|
ultralytics/utils/callbacks/tensorboard.py,sha256=JHOEVlNQ5dYJPd4Z-EvqbXowuK5uA0p8wPgyyaIUQs0,4194
|
240
244
|
ultralytics/utils/callbacks/wb.py,sha256=ayhT2y62AcSOacnawshATU0rWrlSFQ77mrGgBdRl3W4,7086
|
241
|
-
ultralytics-8.3.
|
242
|
-
ultralytics-8.3.
|
243
|
-
ultralytics-8.3.
|
244
|
-
ultralytics-8.3.
|
245
|
-
ultralytics-8.3.
|
246
|
-
ultralytics-8.3.
|
245
|
+
ultralytics-8.3.88.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
246
|
+
ultralytics-8.3.88.dist-info/METADATA,sha256=JLPZ0f4cdD_k5KoIXZCTuF7m2XCOr9YR4yRpp-IxZOI,35169
|
247
|
+
ultralytics-8.3.88.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
248
|
+
ultralytics-8.3.88.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
249
|
+
ultralytics-8.3.88.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
250
|
+
ultralytics-8.3.88.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|