ultralytics 8.3.27__py3-none-any.whl → 8.3.28__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.
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/__init__.py +143 -3
- ultralytics/cfg/default.yaml +1 -1
- ultralytics/data/annotator.py +15 -2
- ultralytics/engine/exporter.py +3 -1
- ultralytics/solutions/ai_gym.py +2 -4
- ultralytics/solutions/solutions.py +19 -4
- ultralytics/utils/__init__.py +1 -0
- ultralytics/utils/benchmarks.py +7 -3
- ultralytics/utils/instance.py +1 -1
- {ultralytics-8.3.27.dist-info → ultralytics-8.3.28.dist-info}/METADATA +4 -4
- {ultralytics-8.3.27.dist-info → ultralytics-8.3.28.dist-info}/RECORD +16 -16
- {ultralytics-8.3.27.dist-info → ultralytics-8.3.28.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.27.dist-info → ultralytics-8.3.28.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.27.dist-info → ultralytics-8.3.28.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.27.dist-info → ultralytics-8.3.28.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/cfg/__init__.py
CHANGED
@@ -7,11 +7,15 @@ from pathlib import Path
|
|
7
7
|
from types import SimpleNamespace
|
8
8
|
from typing import Dict, List, Union
|
9
9
|
|
10
|
+
import cv2
|
11
|
+
|
10
12
|
from ultralytics.utils import (
|
11
13
|
ASSETS,
|
14
|
+
ASSETS_URL,
|
12
15
|
DEFAULT_CFG,
|
13
16
|
DEFAULT_CFG_DICT,
|
14
17
|
DEFAULT_CFG_PATH,
|
18
|
+
DEFAULT_SOL_DICT,
|
15
19
|
IS_VSCODE,
|
16
20
|
LOGGER,
|
17
21
|
RANK,
|
@@ -30,6 +34,17 @@ from ultralytics.utils import (
|
|
30
34
|
yaml_print,
|
31
35
|
)
|
32
36
|
|
37
|
+
# Define valid solutions
|
38
|
+
SOLUTION_MAP = {
|
39
|
+
"count": ("ObjectCounter", "count"),
|
40
|
+
"heatmap": ("Heatmap", "generate_heatmap"),
|
41
|
+
"queue": ("QueueManager", "process_queue"),
|
42
|
+
"speed": ("SpeedEstimator", "estimate_speed"),
|
43
|
+
"workout": ("AIGym", "monitor"),
|
44
|
+
"analytics": ("Analytics", "process_data"),
|
45
|
+
"help": None,
|
46
|
+
}
|
47
|
+
|
33
48
|
# Define valid tasks and modes
|
34
49
|
MODES = {"train", "val", "predict", "export", "track", "benchmark"}
|
35
50
|
TASKS = {"detect", "segment", "classify", "pose", "obb"}
|
@@ -57,6 +72,31 @@ TASK2METRIC = {
|
|
57
72
|
MODELS = {TASK2MODEL[task] for task in TASKS}
|
58
73
|
|
59
74
|
ARGV = sys.argv or ["", ""] # sometimes sys.argv = []
|
75
|
+
SOLUTIONS_HELP_MSG = f"""
|
76
|
+
Arguments received: {str(['yolo'] + ARGV[1:])}. Ultralytics 'yolo solutions' usage overview:
|
77
|
+
|
78
|
+
yolo SOLUTIONS SOLUTION ARGS
|
79
|
+
|
80
|
+
Where SOLUTIONS (required) is a keyword
|
81
|
+
SOLUTION (optional) is one of {list(SOLUTION_MAP.keys())}
|
82
|
+
ARGS (optional) are any number of custom 'arg=value' pairs like 'show_in=True' that override defaults.
|
83
|
+
See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
|
84
|
+
|
85
|
+
1. Call object counting solution
|
86
|
+
yolo solutions count source="path/to/video/file.mp4" region=[(20, 400), (1080, 404), (1080, 360), (20, 360)]
|
87
|
+
|
88
|
+
2. Call heatmaps solution
|
89
|
+
yolo solutions heatmap colormap=cv2.COLORMAP_PARAULA model=yolo11n.pt
|
90
|
+
|
91
|
+
3. Call queue management solution
|
92
|
+
yolo solutions queue region=[(20, 400), (1080, 404), (1080, 360), (20, 360)] model=yolo11n.pt
|
93
|
+
|
94
|
+
4. Call workouts monitoring solution for push-ups
|
95
|
+
yolo solutions workout model=yolo11n-pose.pt kpts=[6, 8, 10]
|
96
|
+
|
97
|
+
5. Generate analytical graphs
|
98
|
+
yolo solutions analytics analytics_type="pie"
|
99
|
+
"""
|
60
100
|
CLI_HELP_MSG = f"""
|
61
101
|
Arguments received: {str(['yolo'] + ARGV[1:])}. Ultralytics 'yolo' commands use the following syntax:
|
62
102
|
|
@@ -78,19 +118,24 @@ CLI_HELP_MSG = f"""
|
|
78
118
|
|
79
119
|
4. Export a YOLO11n classification model to ONNX format at image size 224 by 128 (no TASK required)
|
80
120
|
yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
|
81
|
-
|
121
|
+
|
82
122
|
5. Streamlit real-time webcam inference GUI
|
83
123
|
yolo streamlit-predict
|
84
|
-
|
85
|
-
6.
|
124
|
+
|
125
|
+
6. Ultralytics solutions usage
|
126
|
+
yolo solutions count or in {list(SOLUTION_MAP.keys())} source="path/to/video/file.mp4"
|
127
|
+
|
128
|
+
7. Run special commands:
|
86
129
|
yolo help
|
87
130
|
yolo checks
|
88
131
|
yolo version
|
89
132
|
yolo settings
|
90
133
|
yolo copy-cfg
|
91
134
|
yolo cfg
|
135
|
+
yolo solutions help
|
92
136
|
|
93
137
|
Docs: https://docs.ultralytics.com
|
138
|
+
Solutions: https://docs.ultralytics.com/solutions/
|
94
139
|
Community: https://community.ultralytics.com
|
95
140
|
GitHub: https://github.com/ultralytics/ultralytics
|
96
141
|
"""
|
@@ -568,6 +613,100 @@ def handle_yolo_settings(args: List[str]) -> None:
|
|
568
613
|
LOGGER.warning(f"WARNING ⚠️ settings error: '{e}'. Please see {url} for help.")
|
569
614
|
|
570
615
|
|
616
|
+
def handle_yolo_solutions(args: List[str]) -> None:
|
617
|
+
"""
|
618
|
+
Processes YOLO solutions arguments and runs the specified computer vision solutions pipeline.
|
619
|
+
|
620
|
+
Args:
|
621
|
+
args (List[str]): Command-line arguments for configuring and running the Ultralytics YOLO
|
622
|
+
solutions: https://docs.ultralytics.com/solutions/, It can include solution name, source,
|
623
|
+
and other configuration parameters.
|
624
|
+
|
625
|
+
Returns:
|
626
|
+
None: The function processes video frames and saves the output but doesn't return any value.
|
627
|
+
|
628
|
+
Examples:
|
629
|
+
Run people counting solution with default settings:
|
630
|
+
>>> handle_yolo_solutions(["count"])
|
631
|
+
|
632
|
+
Run analytics with custom configuration:
|
633
|
+
>>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video/file.mp4"])
|
634
|
+
|
635
|
+
Notes:
|
636
|
+
- Default configurations are merged from DEFAULT_SOL_DICT and DEFAULT_CFG_DICT
|
637
|
+
- Arguments can be provided in the format 'key=value' or as boolean flags
|
638
|
+
- Available solutions are defined in SOLUTION_MAP with their respective classes and methods
|
639
|
+
- If an invalid solution is provided, defaults to 'count' solution
|
640
|
+
- Output videos are saved in 'runs/solution/{solution_name}' directory
|
641
|
+
- For 'analytics' solution, frame numbers are tracked for generating analytical graphs
|
642
|
+
- Video processing can be interrupted by pressing 'q'
|
643
|
+
- Processes video frames sequentially and saves output in .avi format
|
644
|
+
- If no source is specified, downloads and uses a default sample video
|
645
|
+
"""
|
646
|
+
full_args_dict = {**DEFAULT_SOL_DICT, **DEFAULT_CFG_DICT} # arguments dictionary
|
647
|
+
overrides = {}
|
648
|
+
|
649
|
+
# check dictionary alignment
|
650
|
+
for arg in merge_equals_args(args):
|
651
|
+
arg = arg.lstrip("-").rstrip(",")
|
652
|
+
if "=" in arg:
|
653
|
+
try:
|
654
|
+
k, v = parse_key_value_pair(arg)
|
655
|
+
overrides[k] = v
|
656
|
+
except (NameError, SyntaxError, ValueError, AssertionError) as e:
|
657
|
+
check_dict_alignment(full_args_dict, {arg: ""}, e)
|
658
|
+
elif arg in full_args_dict and isinstance(full_args_dict.get(arg), bool):
|
659
|
+
overrides[arg] = True
|
660
|
+
check_dict_alignment(full_args_dict, overrides) # dict alignment
|
661
|
+
|
662
|
+
# Get solution name
|
663
|
+
if args and args[0] in SOLUTION_MAP:
|
664
|
+
if args[0] != "help":
|
665
|
+
s_n = args.pop(0) # Extract the solution name directly
|
666
|
+
else:
|
667
|
+
LOGGER.info(SOLUTIONS_HELP_MSG)
|
668
|
+
else:
|
669
|
+
LOGGER.warning(
|
670
|
+
f"⚠️ No valid solution provided. Using default 'count'. Available: {', '.join(SOLUTION_MAP.keys())}"
|
671
|
+
)
|
672
|
+
s_n = "count" # Default solution if none provided
|
673
|
+
|
674
|
+
cls, method = SOLUTION_MAP[s_n] # solution class name, method name and default source
|
675
|
+
|
676
|
+
from ultralytics import solutions # import ultralytics solutions
|
677
|
+
|
678
|
+
solution = getattr(solutions, cls)(IS_CLI=True, **overrides) # get solution class i.e ObjectCounter
|
679
|
+
process = getattr(solution, method) # get specific function of class for processing i.e, count from ObjectCounter
|
680
|
+
|
681
|
+
cap = cv2.VideoCapture(solution.CFG["source"]) # read the video file
|
682
|
+
|
683
|
+
# extract width, height and fps of the video file, create save directory and initialize video writer
|
684
|
+
import os # for directory creation
|
685
|
+
from pathlib import Path
|
686
|
+
|
687
|
+
from ultralytics.utils.files import increment_path # for output directory path update
|
688
|
+
|
689
|
+
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
|
690
|
+
if s_n == "analytics": # analytical graphs follow fixed shape for output i.e w=1920, h=1080
|
691
|
+
w, h = 1920, 1080
|
692
|
+
save_dir = increment_path(Path("runs") / "solutions" / "exp", exist_ok=False)
|
693
|
+
save_dir.mkdir(parents=True, exist_ok=True) # create the output directory
|
694
|
+
vw = cv2.VideoWriter(os.path.join(save_dir, "solution.avi"), cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
|
695
|
+
|
696
|
+
try: # Process video frames
|
697
|
+
f_n = 0 # frame number, required for analytical graphs
|
698
|
+
while cap.isOpened():
|
699
|
+
success, frame = cap.read()
|
700
|
+
if not success:
|
701
|
+
break
|
702
|
+
frame = process(frame, f_n := f_n + 1) if s_n == "analytics" else process(frame)
|
703
|
+
vw.write(frame)
|
704
|
+
if cv2.waitKey(1) & 0xFF == ord("q"):
|
705
|
+
break
|
706
|
+
finally:
|
707
|
+
cap.release()
|
708
|
+
|
709
|
+
|
571
710
|
def handle_streamlit_inference():
|
572
711
|
"""
|
573
712
|
Open the Ultralytics Live Inference Streamlit app for real-time object detection.
|
@@ -709,6 +848,7 @@ def entrypoint(debug=""):
|
|
709
848
|
"logout": lambda: handle_yolo_hub(args),
|
710
849
|
"copy-cfg": copy_default_cfg,
|
711
850
|
"streamlit-predict": lambda: handle_streamlit_inference(),
|
851
|
+
"solutions": lambda: handle_yolo_solutions(args[1:]),
|
712
852
|
}
|
713
853
|
full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
|
714
854
|
|
ultralytics/cfg/default.yaml
CHANGED
@@ -36,7 +36,7 @@ profile: False # (bool) profile ONNX and TensorRT speeds during training for log
|
|
36
36
|
freeze: None # (int | list, optional) freeze first n layers, or freeze list of layer indices during training
|
37
37
|
multi_scale: False # (bool) Whether to use multiscale during training
|
38
38
|
# Segmentation
|
39
|
-
overlap_mask: True # (bool) masks
|
39
|
+
overlap_mask: True # (bool) merge object masks into a single image mask during training (segment train only)
|
40
40
|
mask_ratio: 4 # (int) mask downsample ratio (segment train only)
|
41
41
|
# Classification
|
42
42
|
dropout: 0.0 # (float) use dropout regularization (classify train only)
|
ultralytics/data/annotator.py
CHANGED
@@ -6,7 +6,16 @@ from ultralytics import SAM, YOLO
|
|
6
6
|
|
7
7
|
|
8
8
|
def auto_annotate(
|
9
|
-
data,
|
9
|
+
data,
|
10
|
+
det_model="yolo11x.pt",
|
11
|
+
sam_model="sam_b.pt",
|
12
|
+
device="",
|
13
|
+
conf=0.25,
|
14
|
+
iou=0.45,
|
15
|
+
imgsz=640,
|
16
|
+
max_det=300,
|
17
|
+
classes=None,
|
18
|
+
output_dir=None,
|
10
19
|
):
|
11
20
|
"""
|
12
21
|
Automatically annotates images using a YOLO object detection model and a SAM segmentation model.
|
@@ -22,6 +31,8 @@ def auto_annotate(
|
|
22
31
|
conf (float): Confidence threshold for detection model; default is 0.25.
|
23
32
|
iou (float): IoU threshold for filtering overlapping boxes in detection results; default is 0.45.
|
24
33
|
imgsz (int): Input image resize dimension; default is 640.
|
34
|
+
max_det (int): Limits detections per image to control outputs in dense scenes.
|
35
|
+
classes (list): Filters predictions to specified class IDs, returning only relevant detections.
|
25
36
|
output_dir (str | None): Directory to save the annotated results. If None, a default directory is created.
|
26
37
|
|
27
38
|
Examples:
|
@@ -41,7 +52,9 @@ def auto_annotate(
|
|
41
52
|
output_dir = data.parent / f"{data.stem}_auto_annotate_labels"
|
42
53
|
Path(output_dir).mkdir(exist_ok=True, parents=True)
|
43
54
|
|
44
|
-
det_results = det_model(
|
55
|
+
det_results = det_model(
|
56
|
+
data, stream=True, device=device, conf=conf, iou=iou, imgsz=imgsz, max_det=max_det, classes=classes
|
57
|
+
)
|
45
58
|
|
46
59
|
for result in det_results:
|
47
60
|
class_ids = result.boxes.cls.int().tolist() # noqa
|
ultralytics/engine/exporter.py
CHANGED
@@ -226,6 +226,8 @@ class Exporter:
|
|
226
226
|
if self.args.optimize:
|
227
227
|
assert not ncnn, "optimize=True not compatible with format='ncnn', i.e. use optimize=False"
|
228
228
|
assert self.device.type == "cpu", "optimize=True not compatible with cuda devices, i.e. use device='cpu'"
|
229
|
+
if self.args.int8 and tflite:
|
230
|
+
assert not model.end2end, "TFLite INT8 export not supported for end2end models, please use half precision."
|
229
231
|
if edgetpu:
|
230
232
|
if not LINUX:
|
231
233
|
raise SystemError("Edge TPU export only supported on Linux. See https://coral.ai/docs/edgetpu/compiler")
|
@@ -791,7 +793,7 @@ class Exporter:
|
|
791
793
|
LOGGER.warning(f"{prefix} WARNING ⚠️ 'dynamic=True' model requires max batch size, i.e. 'batch=16'")
|
792
794
|
profile = builder.create_optimization_profile()
|
793
795
|
min_shape = (1, shape[1], 32, 32) # minimum input shape
|
794
|
-
max_shape = (*shape[:2], *(max(1, self.args.workspace) * d for d in shape[2:])) # max input shape
|
796
|
+
max_shape = (*shape[:2], *(int(max(1, self.args.workspace) * d) for d in shape[2:])) # max input shape
|
795
797
|
for inp in inputs:
|
796
798
|
profile.set_shape(inp.name, min=min_shape, opt=shape, max=max_shape)
|
797
799
|
config.add_optimization_profile(profile)
|
ultralytics/solutions/ai_gym.py
CHANGED
@@ -19,7 +19,6 @@ class AIGym(BaseSolution):
|
|
19
19
|
up_angle (float): Angle threshold for considering the 'up' position of an exercise.
|
20
20
|
down_angle (float): Angle threshold for considering the 'down' position of an exercise.
|
21
21
|
kpts (List[int]): Indices of keypoints used for angle calculation.
|
22
|
-
lw (int): Line width for drawing annotations.
|
23
22
|
annotator (Annotator): Object for drawing annotations on the image.
|
24
23
|
|
25
24
|
Methods:
|
@@ -51,7 +50,6 @@ class AIGym(BaseSolution):
|
|
51
50
|
self.up_angle = float(self.CFG["up_angle"]) # Pose up predefined angle to consider up pose
|
52
51
|
self.down_angle = float(self.CFG["down_angle"]) # Pose down predefined angle to consider down pose
|
53
52
|
self.kpts = self.CFG["kpts"] # User selected kpts of workouts storage for further usage
|
54
|
-
self.lw = self.CFG["line_width"] # Store line_width for usage
|
55
53
|
|
56
54
|
def monitor(self, im0):
|
57
55
|
"""
|
@@ -84,14 +82,14 @@ class AIGym(BaseSolution):
|
|
84
82
|
self.stage += ["-"] * new_human
|
85
83
|
|
86
84
|
# Initialize annotator
|
87
|
-
self.annotator = Annotator(im0, line_width=self.
|
85
|
+
self.annotator = Annotator(im0, line_width=self.line_width)
|
88
86
|
|
89
87
|
# Enumerate over keypoints
|
90
88
|
for ind, k in enumerate(reversed(tracks.keypoints.data)):
|
91
89
|
# Get keypoints and estimate the angle
|
92
90
|
kpts = [k[int(self.kpts[i])].cpu() for i in range(3)]
|
93
91
|
self.angle[ind] = self.annotator.estimate_pose_angle(*kpts)
|
94
|
-
im0 = self.annotator.draw_specific_points(k, self.kpts, radius=self.
|
92
|
+
im0 = self.annotator.draw_specific_points(k, self.kpts, radius=self.line_width * 3)
|
95
93
|
|
96
94
|
# Determine stage and count logic based on angle thresholds
|
97
95
|
if self.angle[ind] < self.down_angle:
|
@@ -5,7 +5,7 @@ from collections import defaultdict
|
|
5
5
|
import cv2
|
6
6
|
|
7
7
|
from ultralytics import YOLO
|
8
|
-
from ultralytics.utils import DEFAULT_CFG_DICT, DEFAULT_SOL_DICT, LOGGER
|
8
|
+
from ultralytics.utils import ASSETS_URL, DEFAULT_CFG_DICT, DEFAULT_SOL_DICT, LOGGER
|
9
9
|
from ultralytics.utils.checks import check_imshow, check_requirements
|
10
10
|
|
11
11
|
|
@@ -42,8 +42,12 @@ class BaseSolution:
|
|
42
42
|
>>> solution.display_output(image)
|
43
43
|
"""
|
44
44
|
|
45
|
-
def __init__(self, **kwargs):
|
46
|
-
"""
|
45
|
+
def __init__(self, IS_CLI=False, **kwargs):
|
46
|
+
"""
|
47
|
+
Initializes the `BaseSolution` class with configuration settings and the YOLO model for Ultralytics solutions.
|
48
|
+
|
49
|
+
IS_CLI (optional): Enables CLI mode if set.
|
50
|
+
"""
|
47
51
|
check_requirements("shapely>=2.0.0")
|
48
52
|
from shapely.geometry import LineString, Point, Polygon
|
49
53
|
|
@@ -63,9 +67,20 @@ class BaseSolution:
|
|
63
67
|
) # Store line_width for usage
|
64
68
|
|
65
69
|
# Load Model and store classes names
|
66
|
-
|
70
|
+
if self.CFG["model"] is None:
|
71
|
+
self.CFG["model"] = "yolo11n.pt"
|
72
|
+
self.model = YOLO(self.CFG["model"])
|
67
73
|
self.names = self.model.names
|
68
74
|
|
75
|
+
if IS_CLI: # for CLI, download the source and init video writer
|
76
|
+
if self.CFG["source"] is None:
|
77
|
+
d_s = "solutions_ci_demo.mp4" if "-pose" not in self.CFG["model"] else "solution_ci_pose_demo.mp4"
|
78
|
+
LOGGER.warning(f"⚠️ WARNING: source not provided. using default source {ASSETS_URL}/{d_s}")
|
79
|
+
from ultralytics.utils.downloads import safe_download
|
80
|
+
|
81
|
+
safe_download(f"{ASSETS_URL}/{d_s}") # download source from ultralytics assets
|
82
|
+
self.CFG["source"] = d_s # set default source
|
83
|
+
|
69
84
|
# Initialize environment and region setup
|
70
85
|
self.env_check = check_imshow(warn=True)
|
71
86
|
self.track_history = defaultdict(list)
|
ultralytics/utils/__init__.py
CHANGED
@@ -37,6 +37,7 @@ ARGV = sys.argv or ["", ""] # sometimes sys.argv = []
|
|
37
37
|
FILE = Path(__file__).resolve()
|
38
38
|
ROOT = FILE.parents[1] # YOLO
|
39
39
|
ASSETS = ROOT / "assets" # default images
|
40
|
+
ASSETS_URL = "https://github.com/ultralytics/assets/releases/download/v0.0.0" # assets GitHub URL
|
40
41
|
DEFAULT_CFG_PATH = ROOT / "cfg/default.yaml"
|
41
42
|
DEFAULT_SOL_CFG_PATH = ROOT / "cfg/solutions/default.yaml" # Ultralytics solutions yaml path
|
42
43
|
NUM_THREADS = min(8, max(1, os.cpu_count() - 1)) # number of YOLO multiprocessing threads
|
ultralytics/utils/benchmarks.py
CHANGED
@@ -108,12 +108,16 @@ def benchmark(
|
|
108
108
|
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 TensorFlow exports not supported by onnx2tf yet"
|
109
109
|
if i in {9, 10}: # TF EdgeTPU and TF.js
|
110
110
|
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 TensorFlow exports not supported by onnx2tf yet"
|
111
|
-
if i
|
111
|
+
if i == 11: # Paddle
|
112
112
|
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 Paddle exports not supported yet"
|
113
113
|
assert not is_end2end, "End-to-end models not supported by PaddlePaddle yet"
|
114
114
|
assert LINUX or MACOS, "Windows Paddle exports not supported yet"
|
115
|
-
if i
|
116
|
-
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 MNN
|
115
|
+
if i == 12: # MNN
|
116
|
+
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 MNN exports not supported yet"
|
117
|
+
assert not IS_RASPBERRYPI, "MNN export not supported on Raspberry Pi"
|
118
|
+
assert not IS_JETSON, "MNN export not supported on NVIDIA Jetson"
|
119
|
+
if i == 13: # NCNN
|
120
|
+
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 NCNN exports not supported yet"
|
117
121
|
if "cpu" in device.type:
|
118
122
|
assert cpu, "inference not supported on CPU"
|
119
123
|
if "cuda" in device.type:
|
ultralytics/utils/instance.py
CHANGED
@@ -176,7 +176,7 @@ class Bboxes:
|
|
176
176
|
length as the number of bounding boxes.
|
177
177
|
"""
|
178
178
|
if isinstance(index, int):
|
179
|
-
return Bboxes(self.bboxes[index].
|
179
|
+
return Bboxes(self.bboxes[index].reshape(1, -1))
|
180
180
|
b = self.bboxes[index]
|
181
181
|
assert b.ndim == 2, f"Indexing on Bboxes with {index} failed to return a matrix!"
|
182
182
|
return Bboxes(b)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.28
|
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>
|
@@ -96,8 +96,8 @@ Requires-Dist: streamlit; extra == "solutions"
|
|
96
96
|
|
97
97
|
<div>
|
98
98
|
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
99
|
+
<a href="https://pepy.tech/project/ultralytics"><img src="https://static.pepy.tech/badge/ultralytics" alt="Ultralytics Downloads"></a>
|
99
100
|
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="Ultralytics YOLO Citation"></a>
|
100
|
-
<a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Ultralytics Docker Pulls"></a>
|
101
101
|
<a href="https://discord.com/invite/ultralytics"><img alt="Ultralytics Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
102
102
|
<a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>
|
103
103
|
<a href="https://reddit.com/r/ultralytics"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
|
@@ -143,7 +143,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
|
|
143
143
|
|
144
144
|
Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
145
145
|
|
146
|
-
[](https://pypi.org/project/ultralytics/) [](https://pepy.tech/project/ultralytics) [](https://pypi.org/project/ultralytics/)
|
146
|
+
[](https://pypi.org/project/ultralytics/) [](https://pepy.tech/project/ultralytics) [](https://pypi.org/project/ultralytics/)
|
147
147
|
|
148
148
|
```bash
|
149
149
|
pip install ultralytics
|
@@ -151,7 +151,7 @@ pip install ultralytics
|
|
151
151
|
|
152
152
|
For alternative installation methods including [Conda](https://anaconda.org/conda-forge/ultralytics), [Docker](https://hub.docker.com/r/ultralytics/ultralytics), and Git, please refer to the [Quickstart Guide](https://docs.ultralytics.com/quickstart/).
|
153
153
|
|
154
|
-
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
154
|
+
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
155
155
|
|
156
156
|
</details>
|
157
157
|
|
@@ -7,11 +7,11 @@ tests/test_exports.py,sha256=lE5P5Fftd7z-tThSNJHNI5UTchg_RntxFkxrnhmUHZM,8389
|
|
7
7
|
tests/test_integrations.py,sha256=f5-QCUk1SU_-qn4mBCZwS3GN3tXEBIIXo4z2EhExbHw,6126
|
8
8
|
tests/test_python.py,sha256=I1RRdCwLdrc3jX06huVxct8HX8ccQOmQgVpuEflRl0U,23560
|
9
9
|
tests/test_solutions.py,sha256=sPYhy2d814mIVvojQeVxeZPu0IVy01_Y8zuMcu_9GF0,3790
|
10
|
-
ultralytics/__init__.py,sha256=
|
10
|
+
ultralytics/__init__.py,sha256=xtS8JoiE1smNjmmioTji7vWUpxcUOkx84jZEIAlxISs,681
|
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=
|
14
|
-
ultralytics/cfg/default.yaml,sha256=
|
13
|
+
ultralytics/cfg/__init__.py,sha256=0X6rETee3FHzNENaPrkByFi7dtpj91x4PCYF1-RxKdI,38633
|
14
|
+
ultralytics/cfg/default.yaml,sha256=jlSdLkFAngX6HvrzJHdZ9kdi-xO7utyLc4X2M3NWhEI,8342
|
15
15
|
ultralytics/cfg/datasets/Argoverse.yaml,sha256=FyeuJT5CHq_9d4hlfAf0kpZlnbUMO0S--UJ1yIqcdKk,3134
|
16
16
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=QVfp_Qp-4rukuicaB4qx86NxSHM8Mrzym8l_fIDo8gw,1195
|
17
17
|
ultralytics/cfg/datasets/DOTAv1.yaml,sha256=sxe2P7nY-cCPufH3G1pymnQVtNoGH1y0ETG5CyWfK9g,1165
|
@@ -89,7 +89,7 @@ ultralytics/cfg/solutions/default.yaml,sha256=irtGM8nxaSBkrWMqcXoJdtKgqAq1YBwyVM
|
|
89
89
|
ultralytics/cfg/trackers/botsort.yaml,sha256=FDIrZ3hAhRtMfDl654pt1HIexmPqlFQK-3lQ4D0tF84,918
|
90
90
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=rBWY4RjjX6PTO2o6TUJFYHVgXNZHCN5TuBuzwuPYVjA,723
|
91
91
|
ultralytics/data/__init__.py,sha256=VGe-ATG7j35F4A4r8Jmzffjlhve4JAJPgRa5ahKTU18,616
|
92
|
-
ultralytics/data/annotator.py,sha256=
|
92
|
+
ultralytics/data/annotator.py,sha256=JNmS6uELlEABrU5ViVJiPnjt44v-Us7j39Bwoug_73Y,3117
|
93
93
|
ultralytics/data/augment.py,sha256=YCLrwx1mRGeidggo_7GeINay8KdxACqREHJofZeaTHA,120430
|
94
94
|
ultralytics/data/base.py,sha256=ZCIhAyFfxXVp5fVnYD8mwbksNALJTayBKIR5FKGV7ZM,15168
|
95
95
|
ultralytics/data/build.py,sha256=AfMmz0sHIYmwry_90tEJFRk_kz0S3SolScVXqYHiT08,7261
|
@@ -99,7 +99,7 @@ ultralytics/data/loaders.py,sha256=Fr70Q9p9t7buLW_8R2_lI_nyCMG033gWSxvwy1M-a-U,2
|
|
99
99
|
ultralytics/data/split_dota.py,sha256=eFafJ7Vg52wj6KDCHFJAf1tKzyPD5YaPB8kM4VX5Aeg,10688
|
100
100
|
ultralytics/data/utils.py,sha256=bmWEIrdogj4kssZQSJdSbIF8QsJU00lo-EY-Mgcqv4M,31073
|
101
101
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
102
|
-
ultralytics/engine/exporter.py,sha256=
|
102
|
+
ultralytics/engine/exporter.py,sha256=Bcv_TiMYN6f7dYeLjhOQZjuqXqASYUX0c3vy93sUTuI,60519
|
103
103
|
ultralytics/engine/model.py,sha256=pvL1uf-wwdWL8Iph7VEAYn1-z7wEHzVug21V_0_gO6M,51456
|
104
104
|
ultralytics/engine/predictor.py,sha256=aS4yJdTK2kYq-TTpzIlWxqnAcBz38zIECZoMb_yOPMY,17597
|
105
105
|
ultralytics/engine/results.py,sha256=BxanBI8PhBCfs-9cSy-GS6naScuiD3hdvUAJWPW2mS0,75043
|
@@ -179,14 +179,14 @@ ultralytics/nn/modules/head.py,sha256=3ULpEpr2_I4bd9JSptX_9zRKimdTOm4y8qT-DG-Gzq
|
|
179
179
|
ultralytics/nn/modules/transformer.py,sha256=tGiK8NmPfswwW1rbF21r5ILUkkZQ6Nk4s8j16vFBmps,18069
|
180
180
|
ultralytics/nn/modules/utils.py,sha256=a88cKl2wz1nMVSEBiajtvaCbDBQIkESWOKTZ_WAJy90,3195
|
181
181
|
ultralytics/solutions/__init__.py,sha256=6RDeXWO1QSaMgCq8YrWXaj2xvPw2sJwJL_a0dgjCvz0,648
|
182
|
-
ultralytics/solutions/ai_gym.py,sha256=
|
182
|
+
ultralytics/solutions/ai_gym.py,sha256=Jb9Rbd9gOOj2ox4Q5mqalCdvg3RMXA6Cxe5kS18IFgA,5232
|
183
183
|
ultralytics/solutions/analytics.py,sha256=G4SKg8OPwGsHdUITOeD3pP11iUce1j8ut6HW7BCoJuc,11535
|
184
184
|
ultralytics/solutions/distance_calculation.py,sha256=KN3CC-dm2dTQylj79IrifCJT8ZhE7hc2EweH3KK31mE,5461
|
185
185
|
ultralytics/solutions/heatmap.py,sha256=If9rosSCmE7pAL1HtVnLkx05gQp6nP1K6HzATMcaEEE,5372
|
186
186
|
ultralytics/solutions/object_counter.py,sha256=vKB7riRm8NjHA6IXyf557FpmV-b0_XoKbXHqMHziXSM,8264
|
187
187
|
ultralytics/solutions/parking_management.py,sha256=1DsEE94eauqcnnFxUYI-BX9eA1GbJVNt7oncj1okYpI,11198
|
188
188
|
ultralytics/solutions/queue_management.py,sha256=D9TqwJSVrZQFxp_M8O62WfBAxkAuDWWnXe7FFmnp7_w,4881
|
189
|
-
ultralytics/solutions/solutions.py,sha256=
|
189
|
+
ultralytics/solutions/solutions.py,sha256=wB-w0URApoaykrg0a2XzCCEzODMkeBqbG2xA3iWmeLg,7294
|
190
190
|
ultralytics/solutions/speed_estimation.py,sha256=A10DmuZlGkoZUyfHhZWcDRjj1-9GXiDhEjyBbAzfaDs,4936
|
191
191
|
ultralytics/solutions/streamlit_inference.py,sha256=w4dnvSv2FOrpji9W1Ir86phka3OXc7jd_38-OCbQdZw,5701
|
192
192
|
ultralytics/trackers/__init__.py,sha256=j72IgH2dZHQArMPK4YwcV5ieIw94fYvlGdQjB9cOQKw,227
|
@@ -198,15 +198,15 @@ ultralytics/trackers/utils/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7J
|
|
198
198
|
ultralytics/trackers/utils/gmc.py,sha256=VcURuY041qGCeWUGMxHZBr10T16LtcMqyv7AmTfE1MY,14557
|
199
199
|
ultralytics/trackers/utils/kalman_filter.py,sha256=cH9zD3fwkuezP97H9mw8cSBN7a8hHKx_Sx1j7t3oYGs,21349
|
200
200
|
ultralytics/trackers/utils/matching.py,sha256=3Ie1WNNRZ4_q3365F03XD7Nr9juZB_08mw4yUKC3w74,7162
|
201
|
-
ultralytics/utils/__init__.py,sha256=
|
201
|
+
ultralytics/utils/__init__.py,sha256=08pFkzKn1eR9xdIFhx8tx_8MO-gqXjt2n0HGwDeUlWE,49159
|
202
202
|
ultralytics/utils/autobatch.py,sha256=BO9MCRtrLDtrDQaxqV0BdjaYsgXf-q07Y3_VdGp4URY,4330
|
203
|
-
ultralytics/utils/benchmarks.py,sha256=
|
203
|
+
ultralytics/utils/benchmarks.py,sha256=tKpLuxHYJDmhN98E8jUsX7xWtFn1w1LuoQjwLlM76tA,25459
|
204
204
|
ultralytics/utils/checks.py,sha256=KXQSeauhzecy9tSjyDVy8oXbTDkHSSB9lOTYrqRWpok,29582
|
205
205
|
ultralytics/utils/dist.py,sha256=NDFga-uKxkBX2zLxFHSene_cCiGQJoyOeCXcN9JIOIk,2358
|
206
206
|
ultralytics/utils/downloads.py,sha256=fh7I5toTSowAOXtmx5zIzCEDREfTFG45cLIHmsDmuYw,21974
|
207
207
|
ultralytics/utils/errors.py,sha256=GqP_Jgj_n0paxn8OMhn3DTCgoNkB2WjUcUaqs-M6SQk,816
|
208
208
|
ultralytics/utils/files.py,sha256=uiXQSVABJRoI5ImnM6ndEBIFbECfksmWNEldBg8GnSo,8224
|
209
|
-
ultralytics/utils/instance.py,sha256=
|
209
|
+
ultralytics/utils/instance.py,sha256=EnLp3hCihG5-32eGSMmjzspbxZsDvbqEOs-X0kcvxwQ,16252
|
210
210
|
ultralytics/utils/loss.py,sha256=SW3FVFFp8Ki_LCT8wIdFbm6KmyPcQn3RmKNcvVAhMQI,34174
|
211
211
|
ultralytics/utils/metrics.py,sha256=msPaXc244ndc0NPBhnNlHsKkVhdc-TMgFn5NATlZZVI,53918
|
212
212
|
ultralytics/utils/ops.py,sha256=dsXNdyrYx_p6io6zezig9p84dxS7U-10vceHNVu2IL0,32888
|
@@ -227,9 +227,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=IbGQfEltamUKXJt93uSLQFn8c2rYh3DMTg
|
|
227
227
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
228
228
|
ultralytics/utils/callbacks/tensorboard.py,sha256=SHlE58Fb-sg-uZKtgy-ybIO3SAIfK55aj8kTYGA0Cyg,4167
|
229
229
|
ultralytics/utils/callbacks/wb.py,sha256=oX3JarCJGhzvW556XiEXQNaZblAaK_UETAt3kzkY61w,6869
|
230
|
-
ultralytics-8.3.
|
231
|
-
ultralytics-8.3.
|
232
|
-
ultralytics-8.3.
|
233
|
-
ultralytics-8.3.
|
234
|
-
ultralytics-8.3.
|
235
|
-
ultralytics-8.3.
|
230
|
+
ultralytics-8.3.28.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
231
|
+
ultralytics-8.3.28.dist-info/METADATA,sha256=IbIIi30q4VHA1_C5zJXiQAQ5HQQ1yFNl0nWWaH6_qUQ,35203
|
232
|
+
ultralytics-8.3.28.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
233
|
+
ultralytics-8.3.28.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
234
|
+
ultralytics-8.3.28.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
235
|
+
ultralytics-8.3.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|