ultralytics 8.1.39__py3-none-any.whl → 8.1.40__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.
Potentially problematic release.
This version of ultralytics might be problematic. Click here for more details.
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/__init__.py +3 -3
- ultralytics/data/augment.py +2 -2
- ultralytics/data/base.py +2 -2
- ultralytics/data/converter.py +2 -2
- ultralytics/data/dataset.py +4 -4
- ultralytics/data/loaders.py +11 -8
- ultralytics/data/split_dota.py +1 -1
- ultralytics/data/utils.py +8 -7
- ultralytics/engine/exporter.py +3 -3
- ultralytics/engine/model.py +2 -2
- ultralytics/engine/results.py +2 -2
- ultralytics/engine/trainer.py +13 -13
- ultralytics/engine/validator.py +2 -2
- ultralytics/hub/utils.py +1 -1
- ultralytics/models/fastsam/model.py +1 -1
- ultralytics/models/fastsam/prompt.py +4 -5
- ultralytics/models/nas/model.py +1 -1
- ultralytics/models/sam/model.py +1 -1
- ultralytics/models/sam/modules/tiny_encoder.py +1 -1
- ultralytics/models/yolo/classify/train.py +1 -1
- ultralytics/models/yolo/detect/train.py +1 -1
- ultralytics/models/yolo/world/train.py +16 -15
- ultralytics/nn/autobackend.py +5 -5
- ultralytics/nn/modules/conv.py +1 -1
- ultralytics/nn/modules/head.py +4 -4
- ultralytics/nn/tasks.py +1 -1
- ultralytics/solutions/ai_gym.py +1 -1
- ultralytics/solutions/heatmap.py +1 -1
- ultralytics/trackers/byte_tracker.py +1 -1
- ultralytics/trackers/track.py +1 -1
- ultralytics/trackers/utils/gmc.py +1 -1
- ultralytics/utils/__init__.py +4 -4
- ultralytics/utils/benchmarks.py +2 -2
- ultralytics/utils/callbacks/comet.py +1 -1
- ultralytics/utils/callbacks/mlflow.py +1 -1
- ultralytics/utils/checks.py +3 -3
- ultralytics/utils/downloads.py +2 -2
- ultralytics/utils/metrics.py +1 -1
- ultralytics/utils/plotting.py +1 -1
- ultralytics/utils/torch_utils.py +3 -3
- {ultralytics-8.1.39.dist-info → ultralytics-8.1.40.dist-info}/METADATA +1 -1
- {ultralytics-8.1.39.dist-info → ultralytics-8.1.40.dist-info}/RECORD +47 -47
- {ultralytics-8.1.39.dist-info → ultralytics-8.1.40.dist-info}/LICENSE +0 -0
- {ultralytics-8.1.39.dist-info → ultralytics-8.1.40.dist-info}/WHEEL +0 -0
- {ultralytics-8.1.39.dist-info → ultralytics-8.1.40.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.1.39.dist-info → ultralytics-8.1.40.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/cfg/__init__.py
CHANGED
|
@@ -272,7 +272,7 @@ def get_save_dir(args, name=None):
|
|
|
272
272
|
|
|
273
273
|
project = args.project or (ROOT.parent / "tests/tmp/runs" if TESTS_RUNNING else RUNS_DIR) / args.task
|
|
274
274
|
name = name or args.name or f"{args.mode}"
|
|
275
|
-
save_dir = increment_path(Path(project) / name, exist_ok=args.exist_ok if RANK in
|
|
275
|
+
save_dir = increment_path(Path(project) / name, exist_ok=args.exist_ok if RANK in {-1, 0} else True)
|
|
276
276
|
|
|
277
277
|
return Path(save_dir)
|
|
278
278
|
|
|
@@ -566,10 +566,10 @@ def entrypoint(debug=""):
|
|
|
566
566
|
task = model.task
|
|
567
567
|
|
|
568
568
|
# Mode
|
|
569
|
-
if mode in
|
|
569
|
+
if mode in {"predict", "track"} and "source" not in overrides:
|
|
570
570
|
overrides["source"] = DEFAULT_CFG.source or ASSETS
|
|
571
571
|
LOGGER.warning(f"WARNING ⚠️ 'source' argument is missing. Using default 'source={overrides['source']}'.")
|
|
572
|
-
elif mode in
|
|
572
|
+
elif mode in {"train", "val"}:
|
|
573
573
|
if "data" not in overrides and "resume" not in overrides:
|
|
574
574
|
overrides["data"] = DEFAULT_CFG.data or TASK2DATA.get(task or DEFAULT_CFG.task, DEFAULT_CFG.data)
|
|
575
575
|
LOGGER.warning(f"WARNING ⚠️ 'data' argument is missing. Using default 'data={overrides['data']}'.")
|
ultralytics/data/augment.py
CHANGED
|
@@ -191,7 +191,7 @@ class Mosaic(BaseMixTransform):
|
|
|
191
191
|
def __init__(self, dataset, imgsz=640, p=1.0, n=4):
|
|
192
192
|
"""Initializes the object with a dataset, image size, probability, and border."""
|
|
193
193
|
assert 0 <= p <= 1.0, f"The probability should be in range [0, 1], but got {p}."
|
|
194
|
-
assert n in
|
|
194
|
+
assert n in {4, 9}, "grid must be equal to 4 or 9."
|
|
195
195
|
super().__init__(dataset=dataset, p=p)
|
|
196
196
|
self.dataset = dataset
|
|
197
197
|
self.imgsz = imgsz
|
|
@@ -685,7 +685,7 @@ class RandomFlip:
|
|
|
685
685
|
Default is 'horizontal'.
|
|
686
686
|
flip_idx (array-like, optional): Index mapping for flipping keypoints, if any.
|
|
687
687
|
"""
|
|
688
|
-
assert direction in
|
|
688
|
+
assert direction in {"horizontal", "vertical"}, f"Support direction `horizontal` or `vertical`, got {direction}"
|
|
689
689
|
assert 0 <= p <= 1.0
|
|
690
690
|
|
|
691
691
|
self.p = p
|
ultralytics/data/base.py
CHANGED
|
@@ -15,7 +15,7 @@ import psutil
|
|
|
15
15
|
from torch.utils.data import Dataset
|
|
16
16
|
|
|
17
17
|
from ultralytics.utils import DEFAULT_CFG, LOCAL_RANK, LOGGER, NUM_THREADS, TQDM
|
|
18
|
-
from .utils import HELP_URL, IMG_FORMATS
|
|
18
|
+
from .utils import HELP_URL, FORMATS_HELP_MSG, IMG_FORMATS
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class BaseDataset(Dataset):
|
|
@@ -118,7 +118,7 @@ class BaseDataset(Dataset):
|
|
|
118
118
|
raise FileNotFoundError(f"{self.prefix}{p} does not exist")
|
|
119
119
|
im_files = sorted(x.replace("/", os.sep) for x in f if x.split(".")[-1].lower() in IMG_FORMATS)
|
|
120
120
|
# self.img_files = sorted([x for x in f if x.suffix[1:].lower() in IMG_FORMATS]) # pathlib
|
|
121
|
-
assert im_files, f"{self.prefix}No images found in {img_path}"
|
|
121
|
+
assert im_files, f"{self.prefix}No images found in {img_path}. {FORMATS_HELP_MSG}"
|
|
122
122
|
except Exception as e:
|
|
123
123
|
raise FileNotFoundError(f"{self.prefix}Error loading data from {img_path}\n{HELP_URL}") from e
|
|
124
124
|
if self.fraction < 1:
|
ultralytics/data/converter.py
CHANGED
|
@@ -481,7 +481,7 @@ def merge_multi_segment(segments):
|
|
|
481
481
|
segments[i] = np.roll(segments[i], -idx[0], axis=0)
|
|
482
482
|
segments[i] = np.concatenate([segments[i], segments[i][:1]])
|
|
483
483
|
# Deal with the first segment and the last one
|
|
484
|
-
if i in
|
|
484
|
+
if i in {0, len(idx_list) - 1}:
|
|
485
485
|
s.append(segments[i])
|
|
486
486
|
else:
|
|
487
487
|
idx = [0, idx[1] - idx[0]]
|
|
@@ -489,7 +489,7 @@ def merge_multi_segment(segments):
|
|
|
489
489
|
|
|
490
490
|
else:
|
|
491
491
|
for i in range(len(idx_list) - 1, -1, -1):
|
|
492
|
-
if i not in
|
|
492
|
+
if i not in {0, len(idx_list) - 1}:
|
|
493
493
|
idx = idx_list[i]
|
|
494
494
|
nidx = abs(idx[1] - idx[0])
|
|
495
495
|
s.append(segments[i][nidx:])
|
ultralytics/data/dataset.py
CHANGED
|
@@ -77,7 +77,7 @@ class YOLODataset(BaseDataset):
|
|
|
77
77
|
desc = f"{self.prefix}Scanning {path.parent / path.stem}..."
|
|
78
78
|
total = len(self.im_files)
|
|
79
79
|
nkpt, ndim = self.data.get("kpt_shape", (0, 0))
|
|
80
|
-
if self.use_keypoints and (nkpt <= 0 or ndim not in
|
|
80
|
+
if self.use_keypoints and (nkpt <= 0 or ndim not in {2, 3}):
|
|
81
81
|
raise ValueError(
|
|
82
82
|
"'kpt_shape' in data.yaml missing or incorrect. Should be a list with [number of "
|
|
83
83
|
"keypoints, number of dims (2 for x,y or 3 for x,y,visible)], i.e. 'kpt_shape: [17, 3]'"
|
|
@@ -142,7 +142,7 @@ class YOLODataset(BaseDataset):
|
|
|
142
142
|
|
|
143
143
|
# Display cache
|
|
144
144
|
nf, nm, ne, nc, n = cache.pop("results") # found, missing, empty, corrupt, total
|
|
145
|
-
if exists and LOCAL_RANK in
|
|
145
|
+
if exists and LOCAL_RANK in {-1, 0}:
|
|
146
146
|
d = f"Scanning {cache_path}... {nf} images, {nm + ne} backgrounds, {nc} corrupt"
|
|
147
147
|
TQDM(None, desc=self.prefix + d, total=n, initial=n) # display results
|
|
148
148
|
if cache["msgs"]:
|
|
@@ -235,7 +235,7 @@ class YOLODataset(BaseDataset):
|
|
|
235
235
|
value = values[i]
|
|
236
236
|
if k == "img":
|
|
237
237
|
value = torch.stack(value, 0)
|
|
238
|
-
if k in
|
|
238
|
+
if k in {"masks", "keypoints", "bboxes", "cls", "segments", "obb"}:
|
|
239
239
|
value = torch.cat(value, 0)
|
|
240
240
|
new_batch[k] = value
|
|
241
241
|
new_batch["batch_idx"] = list(new_batch["batch_idx"])
|
|
@@ -334,7 +334,7 @@ class ClassificationDataset(torchvision.datasets.ImageFolder):
|
|
|
334
334
|
assert cache["version"] == DATASET_CACHE_VERSION # matches current version
|
|
335
335
|
assert cache["hash"] == get_hash([x[0] for x in self.samples]) # identical hash
|
|
336
336
|
nf, nc, n, samples = cache.pop("results") # found, missing, empty, corrupt, total
|
|
337
|
-
if LOCAL_RANK in
|
|
337
|
+
if LOCAL_RANK in {-1, 0}:
|
|
338
338
|
d = f"{desc} {nf} images, {nc} corrupt"
|
|
339
339
|
TQDM(None, desc=d, total=n, initial=n)
|
|
340
340
|
if cache["msgs"]:
|
ultralytics/data/loaders.py
CHANGED
|
@@ -15,7 +15,7 @@ import requests
|
|
|
15
15
|
import torch
|
|
16
16
|
from PIL import Image
|
|
17
17
|
|
|
18
|
-
from ultralytics.data.utils import IMG_FORMATS, VID_FORMATS
|
|
18
|
+
from ultralytics.data.utils import IMG_FORMATS, VID_FORMATS, FORMATS_HELP_MSG
|
|
19
19
|
from ultralytics.utils import LOGGER, is_colab, is_kaggle, ops
|
|
20
20
|
from ultralytics.utils.checks import check_requirements
|
|
21
21
|
|
|
@@ -83,7 +83,7 @@ class LoadStreams:
|
|
|
83
83
|
for i, s in enumerate(sources): # index, source
|
|
84
84
|
# Start thread to read frames from video stream
|
|
85
85
|
st = f"{i + 1}/{n}: {s}... "
|
|
86
|
-
if urlparse(s).hostname in
|
|
86
|
+
if urlparse(s).hostname in {"www.youtube.com", "youtube.com", "youtu.be"}: # if source is YouTube video
|
|
87
87
|
# YouTube format i.e. 'https://www.youtube.com/watch?v=Zgi9g1ksQHc' or 'https://youtu.be/LNwODJXcvt4'
|
|
88
88
|
s = get_best_youtube_url(s)
|
|
89
89
|
s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam
|
|
@@ -291,8 +291,14 @@ class LoadImagesAndVideos:
|
|
|
291
291
|
else:
|
|
292
292
|
raise FileNotFoundError(f"{p} does not exist")
|
|
293
293
|
|
|
294
|
-
|
|
295
|
-
videos = [
|
|
294
|
+
# Define files as images or videos
|
|
295
|
+
images, videos = [], []
|
|
296
|
+
for f in files:
|
|
297
|
+
suffix = f.split(".")[-1].lower() # Get file extension without the dot and lowercase
|
|
298
|
+
if suffix in IMG_FORMATS:
|
|
299
|
+
images.append(f)
|
|
300
|
+
elif suffix in VID_FORMATS:
|
|
301
|
+
videos.append(f)
|
|
296
302
|
ni, nv = len(images), len(videos)
|
|
297
303
|
|
|
298
304
|
self.files = images + videos
|
|
@@ -307,10 +313,7 @@ class LoadImagesAndVideos:
|
|
|
307
313
|
else:
|
|
308
314
|
self.cap = None
|
|
309
315
|
if self.nf == 0:
|
|
310
|
-
raise FileNotFoundError(
|
|
311
|
-
f"No images or videos found in {p}. "
|
|
312
|
-
f"Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}"
|
|
313
|
-
)
|
|
316
|
+
raise FileNotFoundError(f"No images or videos found in {p}. {FORMATS_HELP_MSG}")
|
|
314
317
|
|
|
315
318
|
def __iter__(self):
|
|
316
319
|
"""Returns an iterator object for VideoStream or ImageFolder."""
|
ultralytics/data/split_dota.py
CHANGED
|
@@ -71,7 +71,7 @@ def load_yolo_dota(data_root, split="train"):
|
|
|
71
71
|
- train
|
|
72
72
|
- val
|
|
73
73
|
"""
|
|
74
|
-
assert split in
|
|
74
|
+
assert split in {"train", "val"}, f"Split must be 'train' or 'val', not {split}."
|
|
75
75
|
im_dir = Path(data_root) / "images" / split
|
|
76
76
|
assert im_dir.exists(), f"Can't find {im_dir}, please check your data root."
|
|
77
77
|
im_files = glob(str(Path(data_root) / "images" / split / "*"))
|
ultralytics/data/utils.py
CHANGED
|
@@ -39,6 +39,7 @@ HELP_URL = "See https://docs.ultralytics.com/datasets/detect for dataset formatt
|
|
|
39
39
|
IMG_FORMATS = {"bmp", "dng", "jpeg", "jpg", "mpo", "png", "tif", "tiff", "webp", "pfm"} # image suffixes
|
|
40
40
|
VID_FORMATS = {"asf", "avi", "gif", "m4v", "mkv", "mov", "mp4", "mpeg", "mpg", "ts", "wmv", "webm"} # video suffixes
|
|
41
41
|
PIN_MEMORY = str(os.getenv("PIN_MEMORY", True)).lower() == "true" # global pin_memory for dataloaders
|
|
42
|
+
FORMATS_HELP_MSG = f"Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}"
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def img2label_paths(img_paths):
|
|
@@ -63,7 +64,7 @@ def exif_size(img: Image.Image):
|
|
|
63
64
|
exif = img.getexif()
|
|
64
65
|
if exif:
|
|
65
66
|
rotation = exif.get(274, None) # the EXIF key for the orientation tag is 274
|
|
66
|
-
if rotation in
|
|
67
|
+
if rotation in {6, 8}: # rotation 270 or 90
|
|
67
68
|
s = s[1], s[0]
|
|
68
69
|
return s
|
|
69
70
|
|
|
@@ -79,8 +80,8 @@ def verify_image(args):
|
|
|
79
80
|
shape = exif_size(im) # image size
|
|
80
81
|
shape = (shape[1], shape[0]) # hw
|
|
81
82
|
assert (shape[0] > 9) & (shape[1] > 9), f"image size {shape} <10 pixels"
|
|
82
|
-
assert im.format.lower() in IMG_FORMATS, f"
|
|
83
|
-
if im.format.lower() in
|
|
83
|
+
assert im.format.lower() in IMG_FORMATS, f"Invalid image format {im.format}. {FORMATS_HELP_MSG}"
|
|
84
|
+
if im.format.lower() in {"jpg", "jpeg"}:
|
|
84
85
|
with open(im_file, "rb") as f:
|
|
85
86
|
f.seek(-2, 2)
|
|
86
87
|
if f.read() != b"\xff\xd9": # corrupt JPEG
|
|
@@ -105,8 +106,8 @@ def verify_image_label(args):
|
|
|
105
106
|
shape = exif_size(im) # image size
|
|
106
107
|
shape = (shape[1], shape[0]) # hw
|
|
107
108
|
assert (shape[0] > 9) & (shape[1] > 9), f"image size {shape} <10 pixels"
|
|
108
|
-
assert im.format.lower() in IMG_FORMATS, f"invalid image format {im.format}"
|
|
109
|
-
if im.format.lower() in
|
|
109
|
+
assert im.format.lower() in IMG_FORMATS, f"invalid image format {im.format}. {FORMATS_HELP_MSG}"
|
|
110
|
+
if im.format.lower() in {"jpg", "jpeg"}:
|
|
110
111
|
with open(im_file, "rb") as f:
|
|
111
112
|
f.seek(-2, 2)
|
|
112
113
|
if f.read() != b"\xff\xd9": # corrupt JPEG
|
|
@@ -336,7 +337,7 @@ def check_det_dataset(dataset, autodownload=True):
|
|
|
336
337
|
else: # python script
|
|
337
338
|
exec(s, {"yaml": data})
|
|
338
339
|
dt = f"({round(time.time() - t, 1)}s)"
|
|
339
|
-
s = f"success ✅ {dt}, saved to {colorstr('bold', DATASETS_DIR)}" if r in
|
|
340
|
+
s = f"success ✅ {dt}, saved to {colorstr('bold', DATASETS_DIR)}" if r in {0, None} else f"failure {dt} ❌"
|
|
340
341
|
LOGGER.info(f"Dataset download {s}\n")
|
|
341
342
|
check_font("Arial.ttf" if is_ascii(data["names"]) else "Arial.Unicode.ttf") # download fonts
|
|
342
343
|
|
|
@@ -366,7 +367,7 @@ def check_cls_dataset(dataset, split=""):
|
|
|
366
367
|
# Download (optional if dataset=https://file.zip is passed directly)
|
|
367
368
|
if str(dataset).startswith(("http:/", "https:/")):
|
|
368
369
|
dataset = safe_download(dataset, dir=DATASETS_DIR, unzip=True, delete=False)
|
|
369
|
-
elif Path(dataset).suffix in
|
|
370
|
+
elif Path(dataset).suffix in {".zip", ".tar", ".gz"}:
|
|
370
371
|
file = check_file(dataset)
|
|
371
372
|
dataset = safe_download(file, dir=DATASETS_DIR, unzip=True, delete=False)
|
|
372
373
|
|
ultralytics/engine/exporter.py
CHANGED
|
@@ -159,7 +159,7 @@ class Exporter:
|
|
|
159
159
|
_callbacks (dict, optional): Dictionary of callback functions. Defaults to None.
|
|
160
160
|
"""
|
|
161
161
|
self.args = get_cfg(cfg, overrides)
|
|
162
|
-
if self.args.format.lower() in
|
|
162
|
+
if self.args.format.lower() in {"coreml", "mlmodel"}: # fix attempt for protobuf<3.20.x errors
|
|
163
163
|
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python" # must run before TensorBoard callback
|
|
164
164
|
|
|
165
165
|
self.callbacks = _callbacks or callbacks.get_default_callbacks()
|
|
@@ -171,9 +171,9 @@ class Exporter:
|
|
|
171
171
|
self.run_callbacks("on_export_start")
|
|
172
172
|
t = time.time()
|
|
173
173
|
fmt = self.args.format.lower() # to lowercase
|
|
174
|
-
if fmt in
|
|
174
|
+
if fmt in {"tensorrt", "trt"}: # 'engine' aliases
|
|
175
175
|
fmt = "engine"
|
|
176
|
-
if fmt in
|
|
176
|
+
if fmt in {"mlmodel", "mlpackage", "mlprogram", "apple", "ios", "coreml"}: # 'coreml' aliases
|
|
177
177
|
fmt = "coreml"
|
|
178
178
|
fmts = tuple(export_formats()["Argument"][1:]) # available export formats
|
|
179
179
|
flags = [x == fmt for x in fmts]
|
ultralytics/engine/model.py
CHANGED
|
@@ -145,7 +145,7 @@ class Model(nn.Module):
|
|
|
145
145
|
return
|
|
146
146
|
|
|
147
147
|
# Load or create new YOLO model
|
|
148
|
-
if Path(model).suffix in
|
|
148
|
+
if Path(model).suffix in {".yaml", ".yml"}:
|
|
149
149
|
self._new(model, task=task, verbose=verbose)
|
|
150
150
|
else:
|
|
151
151
|
self._load(model, task=task)
|
|
@@ -666,7 +666,7 @@ class Model(nn.Module):
|
|
|
666
666
|
self.trainer.hub_session = self.session # attach optional HUB session
|
|
667
667
|
self.trainer.train()
|
|
668
668
|
# Update model and cfg after training
|
|
669
|
-
if RANK in
|
|
669
|
+
if RANK in {-1, 0}:
|
|
670
670
|
ckpt = self.trainer.best if self.trainer.best.exists() else self.trainer.last
|
|
671
671
|
self.model, _ = attempt_load_one_weight(ckpt)
|
|
672
672
|
self.overrides = self.model.args
|
ultralytics/engine/results.py
CHANGED
|
@@ -470,7 +470,7 @@ class Boxes(BaseTensor):
|
|
|
470
470
|
if boxes.ndim == 1:
|
|
471
471
|
boxes = boxes[None, :]
|
|
472
472
|
n = boxes.shape[-1]
|
|
473
|
-
assert n in
|
|
473
|
+
assert n in {6, 7}, f"expected 6 or 7 values but got {n}" # xyxy, track_id, conf, cls
|
|
474
474
|
super().__init__(boxes, orig_shape)
|
|
475
475
|
self.is_track = n == 7
|
|
476
476
|
self.orig_shape = orig_shape
|
|
@@ -687,7 +687,7 @@ class OBB(BaseTensor):
|
|
|
687
687
|
if boxes.ndim == 1:
|
|
688
688
|
boxes = boxes[None, :]
|
|
689
689
|
n = boxes.shape[-1]
|
|
690
|
-
assert n in
|
|
690
|
+
assert n in {7, 8}, f"expected 7 or 8 values but got {n}" # xywh, rotation, track_id, conf, cls
|
|
691
691
|
super().__init__(boxes, orig_shape)
|
|
692
692
|
self.is_track = n == 8
|
|
693
693
|
self.orig_shape = orig_shape
|
ultralytics/engine/trainer.py
CHANGED
|
@@ -107,7 +107,7 @@ class BaseTrainer:
|
|
|
107
107
|
self.save_dir = get_save_dir(self.args)
|
|
108
108
|
self.args.name = self.save_dir.name # update name for loggers
|
|
109
109
|
self.wdir = self.save_dir / "weights" # weights dir
|
|
110
|
-
if RANK in
|
|
110
|
+
if RANK in {-1, 0}:
|
|
111
111
|
self.wdir.mkdir(parents=True, exist_ok=True) # make dir
|
|
112
112
|
self.args.save_dir = str(self.save_dir)
|
|
113
113
|
yaml_save(self.save_dir / "args.yaml", vars(self.args)) # save run args
|
|
@@ -121,7 +121,7 @@ class BaseTrainer:
|
|
|
121
121
|
print_args(vars(self.args))
|
|
122
122
|
|
|
123
123
|
# Device
|
|
124
|
-
if self.device.type in
|
|
124
|
+
if self.device.type in {"cpu", "mps"}:
|
|
125
125
|
self.args.workers = 0 # faster CPU training as time dominated by inference, not dataloading
|
|
126
126
|
|
|
127
127
|
# Model and Dataset
|
|
@@ -144,7 +144,7 @@ class BaseTrainer:
|
|
|
144
144
|
|
|
145
145
|
# Callbacks
|
|
146
146
|
self.callbacks = _callbacks or callbacks.get_default_callbacks()
|
|
147
|
-
if RANK in
|
|
147
|
+
if RANK in {-1, 0}:
|
|
148
148
|
callbacks.add_integration_callbacks(self)
|
|
149
149
|
|
|
150
150
|
def add_callback(self, event: str, callback):
|
|
@@ -210,7 +210,7 @@ class BaseTrainer:
|
|
|
210
210
|
torch.cuda.set_device(RANK)
|
|
211
211
|
self.device = torch.device("cuda", RANK)
|
|
212
212
|
# LOGGER.info(f'DDP info: RANK {RANK}, WORLD_SIZE {world_size}, DEVICE {self.device}')
|
|
213
|
-
os.environ["
|
|
213
|
+
os.environ["TORCH_NCCL_BLOCKING_WAIT"] = "1" # set to enforce timeout
|
|
214
214
|
dist.init_process_group(
|
|
215
215
|
"nccl" if dist.is_nccl_available() else "gloo",
|
|
216
216
|
timeout=timedelta(seconds=10800), # 3 hours
|
|
@@ -251,7 +251,7 @@ class BaseTrainer:
|
|
|
251
251
|
|
|
252
252
|
# Check AMP
|
|
253
253
|
self.amp = torch.tensor(self.args.amp).to(self.device) # True or False
|
|
254
|
-
if self.amp and RANK in
|
|
254
|
+
if self.amp and RANK in {-1, 0}: # Single-GPU and DDP
|
|
255
255
|
callbacks_backup = callbacks.default_callbacks.copy() # backup callbacks as check_amp() resets them
|
|
256
256
|
self.amp = torch.tensor(check_amp(self.model), device=self.device)
|
|
257
257
|
callbacks.default_callbacks = callbacks_backup # restore callbacks
|
|
@@ -274,7 +274,7 @@ class BaseTrainer:
|
|
|
274
274
|
# Dataloaders
|
|
275
275
|
batch_size = self.batch_size // max(world_size, 1)
|
|
276
276
|
self.train_loader = self.get_dataloader(self.trainset, batch_size=batch_size, rank=RANK, mode="train")
|
|
277
|
-
if RANK in
|
|
277
|
+
if RANK in {-1, 0}:
|
|
278
278
|
# Note: When training DOTA dataset, double batch size could get OOM on images with >2000 objects.
|
|
279
279
|
self.test_loader = self.get_dataloader(
|
|
280
280
|
self.testset, batch_size=batch_size if self.args.task == "obb" else batch_size * 2, rank=-1, mode="val"
|
|
@@ -340,7 +340,7 @@ class BaseTrainer:
|
|
|
340
340
|
self._close_dataloader_mosaic()
|
|
341
341
|
self.train_loader.reset()
|
|
342
342
|
|
|
343
|
-
if RANK in
|
|
343
|
+
if RANK in {-1, 0}:
|
|
344
344
|
LOGGER.info(self.progress_string())
|
|
345
345
|
pbar = TQDM(enumerate(self.train_loader), total=nb)
|
|
346
346
|
self.tloss = None
|
|
@@ -392,7 +392,7 @@ class BaseTrainer:
|
|
|
392
392
|
mem = f"{torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0:.3g}G" # (GB)
|
|
393
393
|
loss_len = self.tloss.shape[0] if len(self.tloss.shape) else 1
|
|
394
394
|
losses = self.tloss if loss_len > 1 else torch.unsqueeze(self.tloss, 0)
|
|
395
|
-
if RANK in
|
|
395
|
+
if RANK in {-1, 0}:
|
|
396
396
|
pbar.set_description(
|
|
397
397
|
("%11s" * 2 + "%11.4g" * (2 + loss_len))
|
|
398
398
|
% (f"{epoch + 1}/{self.epochs}", mem, *losses, batch["cls"].shape[0], batch["img"].shape[-1])
|
|
@@ -405,7 +405,7 @@ class BaseTrainer:
|
|
|
405
405
|
|
|
406
406
|
self.lr = {f"lr/pg{ir}": x["lr"] for ir, x in enumerate(self.optimizer.param_groups)} # for loggers
|
|
407
407
|
self.run_callbacks("on_train_epoch_end")
|
|
408
|
-
if RANK in
|
|
408
|
+
if RANK in {-1, 0}:
|
|
409
409
|
final_epoch = epoch + 1 >= self.epochs
|
|
410
410
|
self.ema.update_attr(self.model, include=["yaml", "nc", "args", "names", "stride", "class_weights"])
|
|
411
411
|
|
|
@@ -447,7 +447,7 @@ class BaseTrainer:
|
|
|
447
447
|
break # must break all DDP ranks
|
|
448
448
|
epoch += 1
|
|
449
449
|
|
|
450
|
-
if RANK in
|
|
450
|
+
if RANK in {-1, 0}:
|
|
451
451
|
# Do final val with best.pt
|
|
452
452
|
LOGGER.info(
|
|
453
453
|
f"\n{epoch - self.start_epoch + 1} epochs completed in "
|
|
@@ -503,12 +503,12 @@ class BaseTrainer:
|
|
|
503
503
|
try:
|
|
504
504
|
if self.args.task == "classify":
|
|
505
505
|
data = check_cls_dataset(self.args.data)
|
|
506
|
-
elif self.args.data.split(".")[-1] in
|
|
506
|
+
elif self.args.data.split(".")[-1] in {"yaml", "yml"} or self.args.task in {
|
|
507
507
|
"detect",
|
|
508
508
|
"segment",
|
|
509
509
|
"pose",
|
|
510
510
|
"obb",
|
|
511
|
-
|
|
511
|
+
}:
|
|
512
512
|
data = check_det_dataset(self.args.data)
|
|
513
513
|
if "yaml_file" in data:
|
|
514
514
|
self.args.data = data["yaml_file"] # for validating 'yolo train data=url.zip' usage
|
|
@@ -740,7 +740,7 @@ class BaseTrainer:
|
|
|
740
740
|
else: # weight (with decay)
|
|
741
741
|
g[0].append(param)
|
|
742
742
|
|
|
743
|
-
if name in
|
|
743
|
+
if name in {"Adam", "Adamax", "AdamW", "NAdam", "RAdam"}:
|
|
744
744
|
optimizer = getattr(optim, name, optim.Adam)(g[2], lr=lr, betas=(momentum, 0.999), weight_decay=0.0)
|
|
745
745
|
elif name == "RMSProp":
|
|
746
746
|
optimizer = optim.RMSprop(g[2], lr=lr, momentum=momentum)
|
ultralytics/engine/validator.py
CHANGED
|
@@ -139,14 +139,14 @@ class BaseValidator:
|
|
|
139
139
|
self.args.batch = 1 # export.py models default to batch-size 1
|
|
140
140
|
LOGGER.info(f"Forcing batch=1 square inference (1,3,{imgsz},{imgsz}) for non-PyTorch models")
|
|
141
141
|
|
|
142
|
-
if str(self.args.data).split(".")[-1] in
|
|
142
|
+
if str(self.args.data).split(".")[-1] in {"yaml", "yml"}:
|
|
143
143
|
self.data = check_det_dataset(self.args.data)
|
|
144
144
|
elif self.args.task == "classify":
|
|
145
145
|
self.data = check_cls_dataset(self.args.data, split=self.args.split)
|
|
146
146
|
else:
|
|
147
147
|
raise FileNotFoundError(emojis(f"Dataset '{self.args.data}' for task={self.args.task} not found ❌"))
|
|
148
148
|
|
|
149
|
-
if self.device.type in
|
|
149
|
+
if self.device.type in {"cpu", "mps"}:
|
|
150
150
|
self.args.workers = 0 # faster CPU val as time dominated by inference, not dataloading
|
|
151
151
|
if not pt:
|
|
152
152
|
self.args.rect = False
|
ultralytics/hub/utils.py
CHANGED
|
@@ -198,7 +198,7 @@ class Events:
|
|
|
198
198
|
}
|
|
199
199
|
self.enabled = (
|
|
200
200
|
SETTINGS["sync"]
|
|
201
|
-
and RANK in
|
|
201
|
+
and RANK in {-1, 0}
|
|
202
202
|
and not TESTS_RUNNING
|
|
203
203
|
and ONLINE
|
|
204
204
|
and (is_pip_package() or get_git_origin_url() == "https://github.com/ultralytics/ultralytics.git")
|
|
@@ -24,7 +24,7 @@ class FastSAM(Model):
|
|
|
24
24
|
"""Call the __init__ method of the parent class (YOLO) with the updated default model."""
|
|
25
25
|
if str(model) == "FastSAM.pt":
|
|
26
26
|
model = "FastSAM-x.pt"
|
|
27
|
-
assert Path(model).suffix not in
|
|
27
|
+
assert Path(model).suffix not in {".yaml", ".yml"}, "FastSAM models only support pre-trained models."
|
|
28
28
|
super().__init__(model=model, task="segment")
|
|
29
29
|
|
|
30
30
|
@property
|
|
@@ -9,7 +9,7 @@ import numpy as np
|
|
|
9
9
|
import torch
|
|
10
10
|
from PIL import Image
|
|
11
11
|
|
|
12
|
-
from ultralytics.utils import TQDM
|
|
12
|
+
from ultralytics.utils import TQDM, checks
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class FastSAMPrompt:
|
|
@@ -33,9 +33,7 @@ class FastSAMPrompt:
|
|
|
33
33
|
try:
|
|
34
34
|
import clip
|
|
35
35
|
except ImportError:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
check_requirements("git+https://github.com/ultralytics/CLIP.git")
|
|
36
|
+
checks.check_requirements("git+https://github.com/ultralytics/CLIP.git")
|
|
39
37
|
import clip
|
|
40
38
|
self.clip = clip
|
|
41
39
|
|
|
@@ -115,7 +113,8 @@ class FastSAMPrompt:
|
|
|
115
113
|
points (list, optional): Points to be plotted. Defaults to None.
|
|
116
114
|
point_label (list, optional): Labels for the points. Defaults to None.
|
|
117
115
|
mask_random_color (bool, optional): Whether to use random color for masks. Defaults to True.
|
|
118
|
-
better_quality (bool, optional): Whether to apply morphological transformations for better mask quality.
|
|
116
|
+
better_quality (bool, optional): Whether to apply morphological transformations for better mask quality.
|
|
117
|
+
Defaults to True.
|
|
119
118
|
retina (bool, optional): Whether to use retina mask. Defaults to False.
|
|
120
119
|
with_contours (bool, optional): Whether to plot contours. Defaults to True.
|
|
121
120
|
"""
|
ultralytics/models/nas/model.py
CHANGED
|
@@ -45,7 +45,7 @@ class NAS(Model):
|
|
|
45
45
|
|
|
46
46
|
def __init__(self, model="yolo_nas_s.pt") -> None:
|
|
47
47
|
"""Initializes the NAS model with the provided or default 'yolo_nas_s.pt' model."""
|
|
48
|
-
assert Path(model).suffix not in
|
|
48
|
+
assert Path(model).suffix not in {".yaml", ".yml"}, "YOLO-NAS models only support pre-trained models."
|
|
49
49
|
super().__init__(model, task="detect")
|
|
50
50
|
|
|
51
51
|
@smart_inference_mode()
|
ultralytics/models/sam/model.py
CHANGED
|
@@ -41,7 +41,7 @@ class SAM(Model):
|
|
|
41
41
|
Raises:
|
|
42
42
|
NotImplementedError: If the model file extension is not .pt or .pth.
|
|
43
43
|
"""
|
|
44
|
-
if model and Path(model).suffix not in
|
|
44
|
+
if model and Path(model).suffix not in {".pt", ".pth"}:
|
|
45
45
|
raise NotImplementedError("SAM prediction requires pre-trained *.pt or *.pth model.")
|
|
46
46
|
super().__init__(model=model, task="segment")
|
|
47
47
|
|
|
@@ -112,7 +112,7 @@ class PatchMerging(nn.Module):
|
|
|
112
112
|
self.out_dim = out_dim
|
|
113
113
|
self.act = activation()
|
|
114
114
|
self.conv1 = Conv2d_BN(dim, out_dim, 1, 1, 0)
|
|
115
|
-
stride_c = 1 if out_dim in
|
|
115
|
+
stride_c = 1 if out_dim in {320, 448, 576} else 2
|
|
116
116
|
self.conv2 = Conv2d_BN(out_dim, out_dim, 3, stride_c, 1, groups=out_dim)
|
|
117
117
|
self.conv3 = Conv2d_BN(out_dim, out_dim, 1, 1, 0)
|
|
118
118
|
|
|
@@ -68,7 +68,7 @@ class ClassificationTrainer(BaseTrainer):
|
|
|
68
68
|
self.model, ckpt = attempt_load_one_weight(model, device="cpu")
|
|
69
69
|
for p in self.model.parameters():
|
|
70
70
|
p.requires_grad = True # for training
|
|
71
|
-
elif model.split(".")[-1] in
|
|
71
|
+
elif model.split(".")[-1] in {"yaml", "yml"}:
|
|
72
72
|
self.model = self.get_model(cfg=model)
|
|
73
73
|
elif model in torchvision.models.__dict__:
|
|
74
74
|
self.model = torchvision.models.__dict__[model](weights="IMAGENET1K_V1" if self.args.pretrained else None)
|
|
@@ -44,7 +44,7 @@ class DetectionTrainer(BaseTrainer):
|
|
|
44
44
|
|
|
45
45
|
def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode="train"):
|
|
46
46
|
"""Construct and return dataloader."""
|
|
47
|
-
assert mode in
|
|
47
|
+
assert mode in {"train", "val"}, f"Mode must be 'train' or 'val', not {mode}."
|
|
48
48
|
with torch_distributed_zero_first(rank): # init dataset *.cache only once if DDP
|
|
49
49
|
dataset = self.build_dataset(dataset_path, mode, batch_size)
|
|
50
50
|
shuffle = mode == "train"
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
2
|
|
|
3
|
+
import itertools
|
|
4
|
+
|
|
5
|
+
from ultralytics.data import build_yolo_dataset
|
|
3
6
|
from ultralytics.models import yolo
|
|
4
7
|
from ultralytics.nn.tasks import WorldModel
|
|
5
|
-
from ultralytics.utils import DEFAULT_CFG, RANK
|
|
6
|
-
from ultralytics.data import build_yolo_dataset
|
|
8
|
+
from ultralytics.utils import DEFAULT_CFG, RANK, checks
|
|
7
9
|
from ultralytics.utils.torch_utils import de_parallel
|
|
8
|
-
from ultralytics.utils.checks import check_requirements
|
|
9
|
-
import itertools
|
|
10
|
-
|
|
11
|
-
try:
|
|
12
|
-
import clip
|
|
13
|
-
except ImportError:
|
|
14
|
-
check_requirements("git+https://github.com/ultralytics/CLIP.git")
|
|
15
|
-
import clip
|
|
16
10
|
|
|
17
11
|
|
|
18
12
|
def on_pretrain_routine_end(trainer):
|
|
19
13
|
"""Callback."""
|
|
20
|
-
if RANK in
|
|
14
|
+
if RANK in {-1, 0}:
|
|
21
15
|
# NOTE: for evaluation
|
|
22
16
|
names = [name.split("/")[0] for name in list(trainer.test_loader.dataset.data["names"].values())]
|
|
23
17
|
de_parallel(trainer.ema.ema).set_classes(names, cache_clip_model=False)
|
|
24
18
|
device = next(trainer.model.parameters()).device
|
|
25
|
-
text_model, _ = clip.load("ViT-B/32", device=device)
|
|
26
|
-
for p in text_model.parameters():
|
|
19
|
+
trainer.text_model, _ = trainer.clip.load("ViT-B/32", device=device)
|
|
20
|
+
for p in trainer.text_model.parameters():
|
|
27
21
|
p.requires_grad_(False)
|
|
28
|
-
trainer.text_model = text_model
|
|
29
22
|
|
|
30
23
|
|
|
31
24
|
class WorldTrainer(yolo.detect.DetectionTrainer):
|
|
@@ -48,6 +41,14 @@ class WorldTrainer(yolo.detect.DetectionTrainer):
|
|
|
48
41
|
overrides = {}
|
|
49
42
|
super().__init__(cfg, overrides, _callbacks)
|
|
50
43
|
|
|
44
|
+
# Import and assign clip
|
|
45
|
+
try:
|
|
46
|
+
import clip
|
|
47
|
+
except ImportError:
|
|
48
|
+
checks.check_requirements("git+https://github.com/ultralytics/CLIP.git")
|
|
49
|
+
import clip
|
|
50
|
+
self.clip = clip
|
|
51
|
+
|
|
51
52
|
def get_model(self, cfg=None, weights=None, verbose=True):
|
|
52
53
|
"""Return WorldModel initialized with specified config and weights."""
|
|
53
54
|
# NOTE: This `nc` here is the max number of different text samples in one image, rather than the actual `nc`.
|
|
@@ -84,7 +85,7 @@ class WorldTrainer(yolo.detect.DetectionTrainer):
|
|
|
84
85
|
|
|
85
86
|
# NOTE: add text features
|
|
86
87
|
texts = list(itertools.chain(*batch["texts"]))
|
|
87
|
-
text_token = clip.tokenize(texts).to(batch["img"].device)
|
|
88
|
+
text_token = self.clip.tokenize(texts).to(batch["img"].device)
|
|
88
89
|
txt_feats = self.text_model.encode_text(text_token).to(dtype=batch["img"].dtype) # torch.float32
|
|
89
90
|
txt_feats = txt_feats / txt_feats.norm(p=2, dim=-1, keepdim=True)
|
|
90
91
|
batch["txt_feats"] = txt_feats.reshape(len(batch["texts"]), -1, txt_feats.shape[-1])
|
ultralytics/nn/autobackend.py
CHANGED
|
@@ -374,9 +374,9 @@ class AutoBackend(nn.Module):
|
|
|
374
374
|
metadata = yaml_load(metadata)
|
|
375
375
|
if metadata:
|
|
376
376
|
for k, v in metadata.items():
|
|
377
|
-
if k in
|
|
377
|
+
if k in {"stride", "batch"}:
|
|
378
378
|
metadata[k] = int(v)
|
|
379
|
-
elif k in
|
|
379
|
+
elif k in {"imgsz", "names", "kpt_shape"} and isinstance(v, str):
|
|
380
380
|
metadata[k] = eval(v)
|
|
381
381
|
stride = metadata["stride"]
|
|
382
382
|
task = metadata["task"]
|
|
@@ -531,8 +531,8 @@ class AutoBackend(nn.Module):
|
|
|
531
531
|
self.names = {i: f"class{i}" for i in range(nc)}
|
|
532
532
|
else: # Lite or Edge TPU
|
|
533
533
|
details = self.input_details[0]
|
|
534
|
-
|
|
535
|
-
if
|
|
534
|
+
is_int = details["dtype"] in {np.int8, np.int16} # is TFLite quantized int8 or int16 model
|
|
535
|
+
if is_int:
|
|
536
536
|
scale, zero_point = details["quantization"]
|
|
537
537
|
im = (im / scale + zero_point).astype(details["dtype"]) # de-scale
|
|
538
538
|
self.interpreter.set_tensor(details["index"], im)
|
|
@@ -540,7 +540,7 @@ class AutoBackend(nn.Module):
|
|
|
540
540
|
y = []
|
|
541
541
|
for output in self.output_details:
|
|
542
542
|
x = self.interpreter.get_tensor(output["index"])
|
|
543
|
-
if
|
|
543
|
+
if is_int:
|
|
544
544
|
scale, zero_point = output["quantization"]
|
|
545
545
|
x = (x.astype(np.float32) - zero_point) * scale # re-scale
|
|
546
546
|
if x.ndim == 3: # if task is not classification, excluding masks (ndim=4) as well
|
ultralytics/nn/modules/conv.py
CHANGED
|
@@ -296,7 +296,7 @@ class SpatialAttention(nn.Module):
|
|
|
296
296
|
def __init__(self, kernel_size=7):
|
|
297
297
|
"""Initialize Spatial-attention module with kernel size argument."""
|
|
298
298
|
super().__init__()
|
|
299
|
-
assert kernel_size in
|
|
299
|
+
assert kernel_size in {3, 7}, "kernel size must be 3 or 7"
|
|
300
300
|
padding = 3 if kernel_size == 7 else 1
|
|
301
301
|
self.cv1 = nn.Conv2d(2, 1, kernel_size, padding=padding, bias=False)
|
|
302
302
|
self.act = nn.Sigmoid()
|
ultralytics/nn/modules/head.py
CHANGED
|
@@ -54,13 +54,13 @@ class Detect(nn.Module):
|
|
|
54
54
|
self.anchors, self.strides = (x.transpose(0, 1) for x in make_anchors(x, self.stride, 0.5))
|
|
55
55
|
self.shape = shape
|
|
56
56
|
|
|
57
|
-
if self.export and self.format in
|
|
57
|
+
if self.export and self.format in {"saved_model", "pb", "tflite", "edgetpu", "tfjs"}: # avoid TF FlexSplitV ops
|
|
58
58
|
box = x_cat[:, : self.reg_max * 4]
|
|
59
59
|
cls = x_cat[:, self.reg_max * 4 :]
|
|
60
60
|
else:
|
|
61
61
|
box, cls = x_cat.split((self.reg_max * 4, self.nc), 1)
|
|
62
62
|
|
|
63
|
-
if self.export and self.format in
|
|
63
|
+
if self.export and self.format in {"tflite", "edgetpu"}:
|
|
64
64
|
# Precompute normalization factor to increase numerical stability
|
|
65
65
|
# See https://github.com/ultralytics/ultralytics/issues/7371
|
|
66
66
|
grid_h = shape[2]
|
|
@@ -230,13 +230,13 @@ class WorldDetect(Detect):
|
|
|
230
230
|
self.anchors, self.strides = (x.transpose(0, 1) for x in make_anchors(x, self.stride, 0.5))
|
|
231
231
|
self.shape = shape
|
|
232
232
|
|
|
233
|
-
if self.export and self.format in
|
|
233
|
+
if self.export and self.format in {"saved_model", "pb", "tflite", "edgetpu", "tfjs"}: # avoid TF FlexSplitV ops
|
|
234
234
|
box = x_cat[:, : self.reg_max * 4]
|
|
235
235
|
cls = x_cat[:, self.reg_max * 4 :]
|
|
236
236
|
else:
|
|
237
237
|
box, cls = x_cat.split((self.reg_max * 4, self.nc), 1)
|
|
238
238
|
|
|
239
|
-
if self.export and self.format in
|
|
239
|
+
if self.export and self.format in {"tflite", "edgetpu"}:
|
|
240
240
|
# Precompute normalization factor to increase numerical stability
|
|
241
241
|
# See https://github.com/ultralytics/ultralytics/issues/7371
|
|
242
242
|
grid_h = shape[2]
|
ultralytics/nn/tasks.py
CHANGED
|
@@ -896,7 +896,7 @@ def parse_model(d, ch, verbose=True): # model_dict, input_channels(3)
|
|
|
896
896
|
) # num heads
|
|
897
897
|
|
|
898
898
|
args = [c1, c2, *args[1:]]
|
|
899
|
-
if m in
|
|
899
|
+
if m in {BottleneckCSP, C1, C2, C2f, C2fAttn, C3, C3TR, C3Ghost, C3x, RepC3}:
|
|
900
900
|
args.insert(2, n) # number of repeats
|
|
901
901
|
n = 1
|
|
902
902
|
elif m is AIFI:
|
ultralytics/solutions/ai_gym.py
CHANGED
|
@@ -81,7 +81,7 @@ class AIGym:
|
|
|
81
81
|
self.annotator = Annotator(im0, line_width=2)
|
|
82
82
|
|
|
83
83
|
for ind, k in enumerate(reversed(self.keypoints)):
|
|
84
|
-
if self.pose_type in
|
|
84
|
+
if self.pose_type in {"pushup", "pullup"}:
|
|
85
85
|
self.angle[ind] = self.annotator.estimate_pose_angle(
|
|
86
86
|
k[int(self.kpts_to_check[0])].cpu(),
|
|
87
87
|
k[int(self.kpts_to_check[1])].cpu(),
|
ultralytics/solutions/heatmap.py
CHANGED
|
@@ -153,7 +153,7 @@ class Heatmap:
|
|
|
153
153
|
self.cls_txtdisplay_gap = cls_txtdisplay_gap
|
|
154
154
|
|
|
155
155
|
# shape of heatmap, if not selected
|
|
156
|
-
if self.shape not in
|
|
156
|
+
if self.shape not in {"circle", "rect"}:
|
|
157
157
|
print("Unknown shape value provided, 'circle' & 'rect' supported")
|
|
158
158
|
print("Using Circular shape now")
|
|
159
159
|
self.shape = "circle"
|
|
@@ -47,7 +47,7 @@ class STrack(BaseTrack):
|
|
|
47
47
|
"""Initialize new STrack instance."""
|
|
48
48
|
super().__init__()
|
|
49
49
|
# xywh+idx or xywha+idx
|
|
50
|
-
assert len(xywh) in
|
|
50
|
+
assert len(xywh) in {5, 6}, f"expected 5 or 6 values but got {len(xywh)}"
|
|
51
51
|
self._tlwh = np.asarray(xywh2ltwh(xywh[:4]), dtype=np.float32)
|
|
52
52
|
self.kalman_filter = None
|
|
53
53
|
self.mean, self.covariance = None, None
|
ultralytics/trackers/track.py
CHANGED
|
@@ -31,7 +31,7 @@ def on_predict_start(predictor: object, persist: bool = False) -> None:
|
|
|
31
31
|
tracker = check_yaml(predictor.args.tracker)
|
|
32
32
|
cfg = IterableSimpleNamespace(**yaml_load(tracker))
|
|
33
33
|
|
|
34
|
-
if cfg.tracker_type not in
|
|
34
|
+
if cfg.tracker_type not in {"bytetrack", "botsort"}:
|
|
35
35
|
raise AssertionError(f"Only 'bytetrack' and 'botsort' are supported for now, but got '{cfg.tracker_type}'")
|
|
36
36
|
|
|
37
37
|
trackers = []
|
ultralytics/utils/__init__.py
CHANGED
|
@@ -41,7 +41,7 @@ VERBOSE = str(os.getenv("YOLO_VERBOSE", True)).lower() == "true" # global verbo
|
|
|
41
41
|
TQDM_BAR_FORMAT = "{l_bar}{bar:10}{r_bar}" if VERBOSE else None # tqdm bar format
|
|
42
42
|
LOGGING_NAME = "ultralytics"
|
|
43
43
|
MACOS, LINUX, WINDOWS = (platform.system() == x for x in ["Darwin", "Linux", "Windows"]) # environment booleans
|
|
44
|
-
ARM64 = platform.machine() in
|
|
44
|
+
ARM64 = platform.machine() in {"arm64", "aarch64"} # ARM64 booleans
|
|
45
45
|
HELP_MSG = """
|
|
46
46
|
Usage examples for running YOLOv8:
|
|
47
47
|
|
|
@@ -359,7 +359,7 @@ def yaml_load(file="data.yaml", append_filename=False):
|
|
|
359
359
|
Returns:
|
|
360
360
|
(dict): YAML data and file name.
|
|
361
361
|
"""
|
|
362
|
-
assert Path(file).suffix in
|
|
362
|
+
assert Path(file).suffix in {".yaml", ".yml"}, f"Attempting to load non-YAML file {file} with yaml_load()"
|
|
363
363
|
with open(file, errors="ignore", encoding="utf-8") as f:
|
|
364
364
|
s = f.read() # string
|
|
365
365
|
|
|
@@ -866,7 +866,7 @@ def set_sentry():
|
|
|
866
866
|
"""
|
|
867
867
|
if "exc_info" in hint:
|
|
868
868
|
exc_type, exc_value, tb = hint["exc_info"]
|
|
869
|
-
if exc_type in
|
|
869
|
+
if exc_type in {KeyboardInterrupt, FileNotFoundError} or "out of memory" in str(exc_value):
|
|
870
870
|
return None # do not send event
|
|
871
871
|
|
|
872
872
|
event["tags"] = {
|
|
@@ -879,7 +879,7 @@ def set_sentry():
|
|
|
879
879
|
|
|
880
880
|
if (
|
|
881
881
|
SETTINGS["sync"]
|
|
882
|
-
and RANK in
|
|
882
|
+
and RANK in {-1, 0}
|
|
883
883
|
and Path(ARGV[0]).name == "yolo"
|
|
884
884
|
and not TESTS_RUNNING
|
|
885
885
|
and ONLINE
|
ultralytics/utils/benchmarks.py
CHANGED
|
@@ -115,7 +115,7 @@ def benchmark(
|
|
|
115
115
|
|
|
116
116
|
# Predict
|
|
117
117
|
assert model.task != "pose" or i != 7, "GraphDef Pose inference is not supported"
|
|
118
|
-
assert i not in
|
|
118
|
+
assert i not in {9, 10}, "inference not supported" # Edge TPU and TF.js are unsupported
|
|
119
119
|
assert i != 5 or platform.system() == "Darwin", "inference only supported on macOS>=10.13" # CoreML
|
|
120
120
|
exported_model.predict(ASSETS / "bus.jpg", imgsz=imgsz, device=device, half=half)
|
|
121
121
|
|
|
@@ -220,7 +220,7 @@ class ProfileModels:
|
|
|
220
220
|
output = []
|
|
221
221
|
for file in files:
|
|
222
222
|
engine_file = file.with_suffix(".engine")
|
|
223
|
-
if file.suffix in
|
|
223
|
+
if file.suffix in {".pt", ".yaml", ".yml"}:
|
|
224
224
|
model = YOLO(str(file))
|
|
225
225
|
model.fuse() # to report correct params and GFLOPs in model.info()
|
|
226
226
|
model_info = model.info()
|
|
@@ -71,7 +71,7 @@ def _get_experiment_type(mode, project_name):
|
|
|
71
71
|
|
|
72
72
|
def _create_experiment(args):
|
|
73
73
|
"""Ensures that the experiment object is only created in a single process during distributed training."""
|
|
74
|
-
if RANK not in
|
|
74
|
+
if RANK not in {-1, 0}:
|
|
75
75
|
return
|
|
76
76
|
try:
|
|
77
77
|
comet_mode = _get_comet_mode()
|
|
@@ -108,7 +108,7 @@ def on_train_end(trainer):
|
|
|
108
108
|
for f in trainer.save_dir.glob("*"): # log all other files in save_dir
|
|
109
109
|
if f.suffix in {".png", ".jpg", ".csv", ".pt", ".yaml"}:
|
|
110
110
|
mlflow.log_artifact(str(f))
|
|
111
|
-
keep_run_active = os.environ.get("MLFLOW_KEEP_RUN_ACTIVE", "False").lower()
|
|
111
|
+
keep_run_active = os.environ.get("MLFLOW_KEEP_RUN_ACTIVE", "False").lower() == "true"
|
|
112
112
|
if keep_run_active:
|
|
113
113
|
LOGGER.info(f"{PREFIX}mlflow run still alive, remember to close it using mlflow.end_run()")
|
|
114
114
|
else:
|
ultralytics/utils/checks.py
CHANGED
|
@@ -237,7 +237,7 @@ def check_version(
|
|
|
237
237
|
result = False
|
|
238
238
|
elif op == "!=" and c == v:
|
|
239
239
|
result = False
|
|
240
|
-
elif op in
|
|
240
|
+
elif op in {">=", ""} and not (c >= v): # if no constraint passed assume '>=required'
|
|
241
241
|
result = False
|
|
242
242
|
elif op == "<=" and not (c <= v):
|
|
243
243
|
result = False
|
|
@@ -500,7 +500,7 @@ def check_file(file, suffix="", download=True, hard=True):
|
|
|
500
500
|
raise FileNotFoundError(f"'{file}' does not exist")
|
|
501
501
|
elif len(files) > 1 and hard:
|
|
502
502
|
raise FileNotFoundError(f"Multiple files match '{file}', specify exact path: {files}")
|
|
503
|
-
return files[0] if len(files) else []
|
|
503
|
+
return files[0] if len(files) else [] # return file
|
|
504
504
|
|
|
505
505
|
|
|
506
506
|
def check_yaml(file, suffix=(".yaml", ".yml"), hard=True):
|
|
@@ -632,7 +632,7 @@ def check_amp(model):
|
|
|
632
632
|
(bool): Returns True if the AMP functionality works correctly with YOLOv8 model, else False.
|
|
633
633
|
"""
|
|
634
634
|
device = next(model.parameters()).device # get model device
|
|
635
|
-
if device.type in
|
|
635
|
+
if device.type in {"cpu", "mps"}:
|
|
636
636
|
return False # AMP only used on CUDA devices
|
|
637
637
|
|
|
638
638
|
def amp_allclose(m, im):
|
ultralytics/utils/downloads.py
CHANGED
|
@@ -356,13 +356,13 @@ def safe_download(
|
|
|
356
356
|
raise ConnectionError(emojis(f"❌ Download failure for {url}. Retry limit reached.")) from e
|
|
357
357
|
LOGGER.warning(f"⚠️ Download failure, retrying {i + 1}/{retry} {url}...")
|
|
358
358
|
|
|
359
|
-
if unzip and f.exists() and f.suffix in
|
|
359
|
+
if unzip and f.exists() and f.suffix in {"", ".zip", ".tar", ".gz"}:
|
|
360
360
|
from zipfile import is_zipfile
|
|
361
361
|
|
|
362
362
|
unzip_dir = (dir or f.parent).resolve() # unzip to dir if provided else unzip in place
|
|
363
363
|
if is_zipfile(f):
|
|
364
364
|
unzip_dir = unzip_file(file=f, path=unzip_dir, exist_ok=exist_ok, progress=progress) # unzip
|
|
365
|
-
elif f.suffix in
|
|
365
|
+
elif f.suffix in {".tar", ".gz"}:
|
|
366
366
|
LOGGER.info(f"Unzipping {f} to {unzip_dir}...")
|
|
367
367
|
subprocess.run(["tar", "xf" if f.suffix == ".tar" else "xfz", f, "--directory", unzip_dir], check=True)
|
|
368
368
|
if delete:
|
ultralytics/utils/metrics.py
CHANGED
|
@@ -298,7 +298,7 @@ class ConfusionMatrix:
|
|
|
298
298
|
self.task = task
|
|
299
299
|
self.matrix = np.zeros((nc + 1, nc + 1)) if self.task == "detect" else np.zeros((nc, nc))
|
|
300
300
|
self.nc = nc # number of classes
|
|
301
|
-
self.conf = 0.25 if conf in
|
|
301
|
+
self.conf = 0.25 if conf in {None, 0.001} else conf # apply 0.25 if default val conf is passed
|
|
302
302
|
self.iou_thres = iou_thres
|
|
303
303
|
|
|
304
304
|
def process_cls_preds(self, preds, targets):
|
ultralytics/utils/plotting.py
CHANGED
|
@@ -904,7 +904,7 @@ def plot_results(file="path/to/results.csv", dir="", segment=False, pose=False,
|
|
|
904
904
|
ax[i].plot(x, y, marker=".", label=f.stem, linewidth=2, markersize=8) # actual results
|
|
905
905
|
ax[i].plot(x, gaussian_filter1d(y, sigma=3), ":", label="smooth", linewidth=2) # smoothing line
|
|
906
906
|
ax[i].set_title(s[j], fontsize=12)
|
|
907
|
-
# if j in
|
|
907
|
+
# if j in {8, 9, 10}: # share train and val loss y axes
|
|
908
908
|
# ax[i].get_shared_y_axes().join(ax[i], ax[i - 5])
|
|
909
909
|
except Exception as e:
|
|
910
910
|
LOGGER.warning(f"WARNING: Plotting error for {f}: {e}")
|
ultralytics/utils/torch_utils.py
CHANGED
|
@@ -37,7 +37,7 @@ TORCHVISION_0_13 = check_version(torchvision.__version__, "0.13.0")
|
|
|
37
37
|
def torch_distributed_zero_first(local_rank: int):
|
|
38
38
|
"""Decorator to make all processes in distributed training wait for each local_master to do something."""
|
|
39
39
|
initialized = torch.distributed.is_available() and torch.distributed.is_initialized()
|
|
40
|
-
if initialized and local_rank not in
|
|
40
|
+
if initialized and local_rank not in {-1, 0}:
|
|
41
41
|
dist.barrier(device_ids=[local_rank])
|
|
42
42
|
yield
|
|
43
43
|
if initialized and local_rank == 0:
|
|
@@ -109,7 +109,7 @@ def select_device(device="", batch=0, newline=False, verbose=True):
|
|
|
109
109
|
for remove in "cuda:", "none", "(", ")", "[", "]", "'", " ":
|
|
110
110
|
device = device.replace(remove, "") # to string, 'cuda:0' -> '0' and '(0, 1)' -> '0,1'
|
|
111
111
|
cpu = device == "cpu"
|
|
112
|
-
mps = device in
|
|
112
|
+
mps = device in {"mps", "mps:0"} # Apple Metal Performance Shaders (MPS)
|
|
113
113
|
if cpu or mps:
|
|
114
114
|
os.environ["CUDA_VISIBLE_DEVICES"] = "-1" # force torch.cuda.is_available() = False
|
|
115
115
|
elif device: # non-cpu device requested
|
|
@@ -347,7 +347,7 @@ def initialize_weights(model):
|
|
|
347
347
|
elif t is nn.BatchNorm2d:
|
|
348
348
|
m.eps = 1e-3
|
|
349
349
|
m.momentum = 0.03
|
|
350
|
-
elif t in
|
|
350
|
+
elif t in {nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU}:
|
|
351
351
|
m.inplace = True
|
|
352
352
|
|
|
353
353
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.1.
|
|
3
|
+
Version: 8.1.40
|
|
4
4
|
Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
|
5
5
|
Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
6
6
|
Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
ultralytics/__init__.py,sha256=
|
|
1
|
+
ultralytics/__init__.py,sha256=TSZwIs2y8cyq-LMs3SXTgNZFZ_JntqXqm5NLRfmdLfQ,625
|
|
2
2
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
3
3
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
4
|
-
ultralytics/cfg/__init__.py,sha256=
|
|
4
|
+
ultralytics/cfg/__init__.py,sha256=ugSQqHCg31bAE9rwhVrnLMNzKLShr9JxDFcN6kBTbUk,21316
|
|
5
5
|
ultralytics/cfg/default.yaml,sha256=2DFD7eZJiKdnUB3eQPIxo8nV6TG4SiZzdaBJnD5Aw2k,8213
|
|
6
6
|
ultralytics/cfg/datasets/Argoverse.yaml,sha256=FyeuJT5CHq_9d4hlfAf0kpZlnbUMO0S--UJ1yIqcdKk,3134
|
|
7
7
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=YDsyFPI6F6-OQXLBM3hOXo3vADYREwZzmMQfJNdpWyM,1193
|
|
@@ -62,40 +62,40 @@ ultralytics/cfg/trackers/botsort.yaml,sha256=YrPmj18p1UU40kJH5NRdL_4S8f7knggkk_q
|
|
|
62
62
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=QvHmtuwulK4X6j3T5VEqtCm0sbWWBUVmWPcCcM20qe0,688
|
|
63
63
|
ultralytics/data/__init__.py,sha256=bGJ8oEBheIj8tQ2q3d7JqiVJUT4Ft9lXkDXOvBUj6Q0,637
|
|
64
64
|
ultralytics/data/annotator.py,sha256=evXQzARVerc0hb9ol-n_GrrHf-dlXO4lCMMWEZoJ2UM,2117
|
|
65
|
-
ultralytics/data/augment.py,sha256=
|
|
66
|
-
ultralytics/data/base.py,sha256=
|
|
65
|
+
ultralytics/data/augment.py,sha256=tU1HGE7Dm-cjPvXfKyNpThzYCGO54RgcN3WR0SgjfpU,57388
|
|
66
|
+
ultralytics/data/base.py,sha256=8DwF1_H0GIdTbF6iSm-763TK3ez3El9aZVix0h-X-c0,13470
|
|
67
67
|
ultralytics/data/build.py,sha256=CgUq3g3s5Kc6UXDjCkx-rfmK2biRqhGHZWY21tnJOk0,7265
|
|
68
|
-
ultralytics/data/converter.py,sha256=
|
|
69
|
-
ultralytics/data/dataset.py,sha256=
|
|
70
|
-
ultralytics/data/loaders.py,sha256=
|
|
71
|
-
ultralytics/data/split_dota.py,sha256=
|
|
72
|
-
ultralytics/data/utils.py,sha256=
|
|
68
|
+
ultralytics/data/converter.py,sha256=Y0V4xuCqge55gXbXHhWZij52zx27BFAKCspyxrg_MFs,17527
|
|
69
|
+
ultralytics/data/dataset.py,sha256=THxFiJdawrdrC9MB4Moayml70gQ6ophAa_3F5_V_jlk,22011
|
|
70
|
+
ultralytics/data/loaders.py,sha256=2GOYHELK9nh7RlIcqUqg3kuRgWUvXT43mI2P_XOtxCA,23146
|
|
71
|
+
ultralytics/data/split_dota.py,sha256=PQdkwwlFtLKhWIrbToshSekXGdgbrbYMN6hM4ujfa7o,10010
|
|
72
|
+
ultralytics/data/utils.py,sha256=7zaL2N9Hp3ki1EI31NuthMVJS9uEcakDjoN-2t7Amw4,30869
|
|
73
73
|
ultralytics/data/explorer/__init__.py,sha256=-Y3m1ZedepOQUv_KW82zaGxvU_PSHcuwUTFqG9BhAr4,113
|
|
74
74
|
ultralytics/data/explorer/explorer.py,sha256=9i_TlOfC87m2_tL4UR6ZjRb_T_mZNCMLIYMVWtD4pkY,18782
|
|
75
75
|
ultralytics/data/explorer/utils.py,sha256=a6ugY8rKpFM8dIRcUwRyjRkRJ-zXEwe-NiJr6CLVlus,7041
|
|
76
76
|
ultralytics/data/explorer/gui/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
77
77
|
ultralytics/data/explorer/gui/dash.py,sha256=a2s8oJKI8kqnWEcIyqCCzvIyvM_uZmfMaxrOdwmiq7k,10044
|
|
78
78
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
79
|
-
ultralytics/engine/exporter.py,sha256
|
|
80
|
-
ultralytics/engine/model.py,sha256=
|
|
79
|
+
ultralytics/engine/exporter.py,sha256=ZQNF6SUj0NlgUCr9Tbj2TQJxLrgEJJPfdyo4LtL_WJA,53790
|
|
80
|
+
ultralytics/engine/model.py,sha256=HXbjmIGCpEia7geNObJ9iw79zdLeIyer4BNUrsporRk,39541
|
|
81
81
|
ultralytics/engine/predictor.py,sha256=wQRKdWGDTP5A6CS0gTC6U3RPDMhP3QkEzWSPm6eqCkU,17022
|
|
82
|
-
ultralytics/engine/results.py,sha256=
|
|
83
|
-
ultralytics/engine/trainer.py,sha256=
|
|
82
|
+
ultralytics/engine/results.py,sha256=MvrOBrBlRF7kbL-QwysMf9mIDy_lwQBTTYvy1x1FMME,30667
|
|
83
|
+
ultralytics/engine/trainer.py,sha256=pljuLoqwhv3pIA99Ua3-jWG91vqL3VAgOTyz90AeAJg,34975
|
|
84
84
|
ultralytics/engine/tuner.py,sha256=zttHrQkvXuUVTB7jmM4Z85GgIsQ2hjpW9YrMccrQ4wo,11829
|
|
85
|
-
ultralytics/engine/validator.py,sha256=
|
|
85
|
+
ultralytics/engine/validator.py,sha256=p0irfLSZa3-0TtcuGheI8kNbzPUqs_UM3TMK4VRUGK4,14645
|
|
86
86
|
ultralytics/hub/__init__.py,sha256=U4j-2QPdwSDlxw6RgFYnnJXOoIzLtwke4TkY2A8q4ws,5068
|
|
87
87
|
ultralytics/hub/auth.py,sha256=hc97pJ01OfI8oQ7uw3ubKbiVCDSGxSGJHoo9W6hrrNw,5403
|
|
88
88
|
ultralytics/hub/session.py,sha256=kFwufDIY7TeV79DdEQBKYrU5883WxgCrpJoTr1S5QuE,14649
|
|
89
|
-
ultralytics/hub/utils.py,sha256=
|
|
89
|
+
ultralytics/hub/utils.py,sha256=U0Bd-cwc1DvHwmM1CWB7Fr4MwfPi9SkF1tPUnHyy3qc,9729
|
|
90
90
|
ultralytics/models/__init__.py,sha256=xrzn2dcLBG6Ujxll8LtlTIblPar2gjNhAwjAQg7u8sk,197
|
|
91
91
|
ultralytics/models/fastsam/__init__.py,sha256=0dt65jZ_5b7Q-mdXN8MSEkgnFRA0FIwlel_LS2RaOlU,254
|
|
92
|
-
ultralytics/models/fastsam/model.py,sha256=
|
|
92
|
+
ultralytics/models/fastsam/model.py,sha256=yOf-byvFxafXYTEoc9j1dYnE2XFNErRYSnroyGxkW7I,1054
|
|
93
93
|
ultralytics/models/fastsam/predict.py,sha256=0WHUFrqHUNy1cTNpLKsN0FKqLKCvr7fHU6pp91_QVg0,4121
|
|
94
|
-
ultralytics/models/fastsam/prompt.py,sha256=
|
|
94
|
+
ultralytics/models/fastsam/prompt.py,sha256=H-EtgJAz2I0iSEVzNEw_DdhBdELxzGZ2FnL0dvxssf0,16132
|
|
95
95
|
ultralytics/models/fastsam/utils.py,sha256=r-b362Wb7P2ZAlOwWckPJM6HLvg-eFDDz4wkA0ymLd0,2157
|
|
96
96
|
ultralytics/models/fastsam/val.py,sha256=ILKmw3U8FYmmQsO9wk9-bJ9Pyp_ZthJM36b61L75s3Y,1967
|
|
97
97
|
ultralytics/models/nas/__init__.py,sha256=d6-WTrYLXvbPs58ebA0-583ODi-VyzXc-t4aGIDQK6M,179
|
|
98
|
-
ultralytics/models/nas/model.py,sha256=
|
|
98
|
+
ultralytics/models/nas/model.py,sha256=roo4H9YcDX2s-qxxoIHTJiueNSMeul2F0scB5WUYlPs,2864
|
|
99
99
|
ultralytics/models/nas/predict.py,sha256=O7f92KE6hi5DENTRzXiMsm-qK-ndVoO1Bs3dugp8aLA,2136
|
|
100
100
|
ultralytics/models/nas/val.py,sha256=u35kVTVgGxK_rbHytUvFB4F3_nZn4MPv3PbZLFWSmkQ,1680
|
|
101
101
|
ultralytics/models/rtdetr/__init__.py,sha256=AZga1C3qlGTtgpAupDW4doijq5aZlQeF8e55_DP2Uas,197
|
|
@@ -106,13 +106,13 @@ ultralytics/models/rtdetr/val.py,sha256=6bNhHl_6JbpjuW4nlaojjDgmhbUNJy0J5Qz8FXZI
|
|
|
106
106
|
ultralytics/models/sam/__init__.py,sha256=9A1iyfPN_ncqq3TMExe_-uPoARjEX3psoHEI1xMG2VE,144
|
|
107
107
|
ultralytics/models/sam/amg.py,sha256=MsKSRS2SieZK_n-m2ICk1QpcYogl5mofcsVa-4FXYvo,7935
|
|
108
108
|
ultralytics/models/sam/build.py,sha256=jJvloRbPwHvSnVWwM3pEdzpM5MdIcEHbRaqQk_S9lG8,4943
|
|
109
|
-
ultralytics/models/sam/model.py,sha256=
|
|
109
|
+
ultralytics/models/sam/model.py,sha256=H87wexHJ84wbtfKVrZe6I-VuLlhI8h6XeNpxe0D-Sgc,4706
|
|
110
110
|
ultralytics/models/sam/predict.py,sha256=C8dErpMefMwQvReJSvxRMaTala6OJbAckrGO3m508kI,23632
|
|
111
111
|
ultralytics/models/sam/modules/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
112
112
|
ultralytics/models/sam/modules/decoders.py,sha256=7NWnBNupxGYvH0S1N0R6NBHxdVFRUrrnL9EqAw09J4E,7816
|
|
113
113
|
ultralytics/models/sam/modules/encoders.py,sha256=pRNZHzt2J2xD_D0Btu8pk4DcItfr6dRr9rcRfxoZZhU,24746
|
|
114
114
|
ultralytics/models/sam/modules/sam.py,sha256=zC4l4kcrIQD_ekczjl2l6dgaABqqjROZxQ-FDb-itt0,2783
|
|
115
|
-
ultralytics/models/sam/modules/tiny_encoder.py,sha256=
|
|
115
|
+
ultralytics/models/sam/modules/tiny_encoder.py,sha256=kxEh4nZn5lwRYTSuauEQNg7uzibuKiLDzzwx5MD5WMY,29135
|
|
116
116
|
ultralytics/models/sam/modules/transformer.py,sha256=-wboK4gNKOJMP8J8ACN2JoK-xze40NZG696HsxdYObs,11170
|
|
117
117
|
ultralytics/models/utils/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
118
118
|
ultralytics/models/utils/loss.py,sha256=IMzcnDwwkgO9F6GDKVxrDdVdhUX_7d9uY4tX-AgtT0g,15134
|
|
@@ -121,11 +121,11 @@ ultralytics/models/yolo/__init__.py,sha256=e1cZr9pbSbf3Ya2OvkTjGRwD_E2YZpe610xsk
|
|
|
121
121
|
ultralytics/models/yolo/model.py,sha256=PJwBkdDkgyPuQBuIcAx5uDb78JwYg56nFeYMyzBY_nY,3991
|
|
122
122
|
ultralytics/models/yolo/classify/__init__.py,sha256=t-4pUHmgI2gjhc-l3bqNEcEtKD1dO40nD4Vc6Y2xD6o,355
|
|
123
123
|
ultralytics/models/yolo/classify/predict.py,sha256=wFY4GIlWxe7idMndEw1RnDI63o53MTfiHKz0s2fOjAY,2513
|
|
124
|
-
ultralytics/models/yolo/classify/train.py,sha256=
|
|
124
|
+
ultralytics/models/yolo/classify/train.py,sha256=Q5gN5Zq0mVV7DsLLBcGNhrWhoVYjJlqwTPSotbR87-8,6838
|
|
125
125
|
ultralytics/models/yolo/classify/val.py,sha256=EP_hjRExXgdI4xojTKvj_YeNdaz_i2CoUzorl55r0OA,4861
|
|
126
126
|
ultralytics/models/yolo/detect/__init__.py,sha256=JR8gZJWn7wMBbh-0j_073nxJVZTMFZVWTOG5Wnvk6w0,229
|
|
127
127
|
ultralytics/models/yolo/detect/predict.py,sha256=_a9vH3DmKFY6eeztFTdj3nkfu_MKG6n7zb5rRKGjs9I,1510
|
|
128
|
-
ultralytics/models/yolo/detect/train.py,sha256=
|
|
128
|
+
ultralytics/models/yolo/detect/train.py,sha256=8Ulq1SPNLrkOqXj0Yt5zNR1c_Xl_QnOjllCdqBHUMds,6353
|
|
129
129
|
ultralytics/models/yolo/detect/val.py,sha256=KznQpsllz3_4YAv2kSub2y75q5XQXz0UHay3zta2P30,14416
|
|
130
130
|
ultralytics/models/yolo/obb/__init__.py,sha256=txWbPGLY1_M7ZwlLQjrwGjTBOlsv9P3yk5ZEgysTinU,193
|
|
131
131
|
ultralytics/models/yolo/obb/predict.py,sha256=prfDzhwuVHKF6CRwnFVBA-YFI5q7U7NEQwITGHmB2Ow,2037
|
|
@@ -140,64 +140,64 @@ ultralytics/models/yolo/segment/predict.py,sha256=xtA0ZZyuh9WVpX7zZFdAeCkWnxhQ30
|
|
|
140
140
|
ultralytics/models/yolo/segment/train.py,sha256=aOQpDIptZfKSl9mFa6B-3W3QccMRlmBINBkI9K8-3sQ,2298
|
|
141
141
|
ultralytics/models/yolo/segment/val.py,sha256=njiF6RWddS-HOWxVvlk5PXRw6UOgEt_HEOZVPF7rruQ,11745
|
|
142
142
|
ultralytics/models/yolo/world/__init__.py,sha256=3VTH0q4NOt2EWRom15yCymvmvm0Etp2bmETJUhsVTBI,103
|
|
143
|
-
ultralytics/models/yolo/world/train.py,sha256=
|
|
143
|
+
ultralytics/models/yolo/world/train.py,sha256=acYN2-onL69LrL4av6_hY2r5AY0urC0WViDstn7npfI,3686
|
|
144
144
|
ultralytics/models/yolo/world/train_world.py,sha256=5IXNJU9otTH0e5_Lo0Fyu-rmVgkPWuSDOrqAL9hFu3s,4805
|
|
145
145
|
ultralytics/nn/__init__.py,sha256=4BPLHY89xEM_al5uK0aOmFgiML6CMGEZbezxOvTjOEs,587
|
|
146
|
-
ultralytics/nn/autobackend.py,sha256=
|
|
147
|
-
ultralytics/nn/tasks.py,sha256=
|
|
146
|
+
ultralytics/nn/autobackend.py,sha256=QtPDtQfUNnTGiW6yJnWGNWR_aqkYDFIevyx22uC2bdI,28716
|
|
147
|
+
ultralytics/nn/tasks.py,sha256=UKPA4T-QX50qUTemlKO2FB_vR9U19E6K5KVAriFs-xY,43623
|
|
148
148
|
ultralytics/nn/modules/__init__.py,sha256=Ga3MDpwX6DeI7VSH8joti5uleP4mgkQGolbe8RLZ2T8,2326
|
|
149
149
|
ultralytics/nn/modules/block.py,sha256=smIz3oNTDA7UKrAH5FfSMh08C12-avgWTeIkbgZIv18,25251
|
|
150
|
-
ultralytics/nn/modules/conv.py,sha256=
|
|
151
|
-
ultralytics/nn/modules/head.py,sha256=
|
|
150
|
+
ultralytics/nn/modules/conv.py,sha256=Ywe87IhuaS22mR2JJ9xjnW8Sb-m7WTjxuqIxV_Dv8lI,12722
|
|
151
|
+
ultralytics/nn/modules/head.py,sha256=djW6YGN70mFYGDkMFV1xj1WZJtA9yKsNxmtnPVSxukY,22337
|
|
152
152
|
ultralytics/nn/modules/transformer.py,sha256=AxD9uURpCl-EqvXe3DiG6JW-pBzB16G-AahLdZ7yayo,17909
|
|
153
153
|
ultralytics/nn/modules/utils.py,sha256=779QnnKp9v8jv251ESduTXJ0ol8HkIOLbGQWwEGQjhU,3196
|
|
154
154
|
ultralytics/solutions/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
155
|
-
ultralytics/solutions/ai_gym.py,sha256=
|
|
155
|
+
ultralytics/solutions/ai_gym.py,sha256=IZHpvmNyEQT_aqMTrA5sIjCsl3_5Zl2WG31HxGT6KV4,5696
|
|
156
156
|
ultralytics/solutions/distance_calculation.py,sha256=N1QB5uDG_6sp8jD5uSwp_NTPmyP4UCqJm9G2lNrgpr8,6334
|
|
157
|
-
ultralytics/solutions/heatmap.py,sha256=
|
|
157
|
+
ultralytics/solutions/heatmap.py,sha256=PjRI0PRhPwO1RE-NSDXlbvgCXTnGtD-HvI0HMKwUOkE,12902
|
|
158
158
|
ultralytics/solutions/object_counter.py,sha256=LOExuFduOKJcs94pWpv27jgLAZJxHDsmxouXKVBS10s,12058
|
|
159
159
|
ultralytics/solutions/speed_estimation.py,sha256=lvaU-F8f3V4KFVKFaNS7isIdYtMSFjh_zF9gl0Mals8,6714
|
|
160
160
|
ultralytics/trackers/__init__.py,sha256=j72IgH2dZHQArMPK4YwcV5ieIw94fYvlGdQjB9cOQKw,227
|
|
161
161
|
ultralytics/trackers/basetrack.py,sha256=-vBDD-Q9lsxfTMK2w9kuqWGrYbRMmaBCCEbGGyR53gE,3675
|
|
162
162
|
ultralytics/trackers/bot_sort.py,sha256=39AvhYVbT7izF3--rX_e6Lhgb5czTA23gw6AgnNcRds,8601
|
|
163
|
-
ultralytics/trackers/byte_tracker.py,sha256=
|
|
164
|
-
ultralytics/trackers/track.py,sha256=
|
|
163
|
+
ultralytics/trackers/byte_tracker.py,sha256=OH1AfBZ7TXzjRPyvrsaWnbqI1CqWxdErMrGazKJ5GtM,18871
|
|
164
|
+
ultralytics/trackers/track.py,sha256=Brp7G1le2kLs-8PTOzDllpUBW6ps_Wta2qx2GUPI7TU,3462
|
|
165
165
|
ultralytics/trackers/utils/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
166
|
-
ultralytics/trackers/utils/gmc.py,sha256=
|
|
166
|
+
ultralytics/trackers/utils/gmc.py,sha256=vwcPA1n5zjPaBGhCDt8ItN7rq_6Sczsjn4gsXJfRylU,13688
|
|
167
167
|
ultralytics/trackers/utils/kalman_filter.py,sha256=JN1sAcfJZy8fTZxc8w3jUJnGQDKtgAL__p4nTR6RM2I,15168
|
|
168
168
|
ultralytics/trackers/utils/matching.py,sha256=c_pthBfu9sWeMVYe-dSecdWcQxUey-mQT2yMVsFH3VQ,5404
|
|
169
|
-
ultralytics/utils/__init__.py,sha256=
|
|
169
|
+
ultralytics/utils/__init__.py,sha256=ChS67z-V8SQDK43FWu1hfDJCLp2cLitLP4HCQtVJKY8,37539
|
|
170
170
|
ultralytics/utils/autobatch.py,sha256=ygZ3f2ByIkcujB89ENcTnGWWnAQw5Pbg6nBuShg-5t4,3863
|
|
171
|
-
ultralytics/utils/benchmarks.py,sha256=
|
|
172
|
-
ultralytics/utils/checks.py,sha256=
|
|
171
|
+
ultralytics/utils/benchmarks.py,sha256=fpNWdrty1ULKP3jHFrRNln_o9gIT03F4KOE5xPuy0WI,18285
|
|
172
|
+
ultralytics/utils/checks.py,sha256=3RFDw6trjQt8A8sbs0e3NsC25WO2ISYGromUKntmvr4,27922
|
|
173
173
|
ultralytics/utils/dist.py,sha256=3HeNbY2gp7vYhcvVhsrvTrQXpQmgT8tpmnzApf3eQRA,2267
|
|
174
|
-
ultralytics/utils/downloads.py,sha256=
|
|
174
|
+
ultralytics/utils/downloads.py,sha256=j1S27awWiLTt1qC9l53WqH_BilM13JHLSVmQ2xFqh-4,21496
|
|
175
175
|
ultralytics/utils/errors.py,sha256=GqP_Jgj_n0paxn8OMhn3DTCgoNkB2WjUcUaqs-M6SQk,816
|
|
176
176
|
ultralytics/utils/files.py,sha256=TVfY0Wi5IsUc4YdsDzC0dAg-jAP5exYvwqB3VmXhDLY,6761
|
|
177
177
|
ultralytics/utils/instance.py,sha256=fPClvPPtTk8VeXWiRv90DrFk1j1lTUKdYJtpZKUDDtA,15575
|
|
178
178
|
ultralytics/utils/loss.py,sha256=lOFBx-lKn-aGHUIPTb1NQefXiNot07egNx7qKErChpU,32716
|
|
179
|
-
ultralytics/utils/metrics.py,sha256=
|
|
179
|
+
ultralytics/utils/metrics.py,sha256=xKcQFjkrOpA5JtlC9K9F3BF40h09ejC8w0jKSbR3gCE,53473
|
|
180
180
|
ultralytics/utils/ops.py,sha256=GFe_tx8MVKT56xelbAuQjiJ28ohpzARpD6BzGyJ1yMk,33264
|
|
181
181
|
ultralytics/utils/patches.py,sha256=SgMqeMsq2K6JoBJP1NplXMl9C6rK0JeJUChjBrJOneo,2750
|
|
182
|
-
ultralytics/utils/plotting.py,sha256=
|
|
182
|
+
ultralytics/utils/plotting.py,sha256=ILz1jEpmMQxeAdEHQ-E66XEJbsyYZqWhgQpLhDNpXvk,45077
|
|
183
183
|
ultralytics/utils/tal.py,sha256=xuIyryUjaaYHkHPG9GvBwh1xxN2Hq4y3hXOtuERehwY,16017
|
|
184
|
-
ultralytics/utils/torch_utils.py,sha256=
|
|
184
|
+
ultralytics/utils/torch_utils.py,sha256=aBCUPtVLTkdtsImlDaN0f8BCiGESU5rzTVhm74lCQms,25743
|
|
185
185
|
ultralytics/utils/triton.py,sha256=gg1finxno_tY2Ge9PMhmu7PI9wvoFZoiicdT4Bhqv3w,3936
|
|
186
186
|
ultralytics/utils/tuner.py,sha256=JhvBp6haKA6eqpNPpGJzzjjCmPxBx5phk9kHmt_jppw,6171
|
|
187
187
|
ultralytics/utils/callbacks/__init__.py,sha256=YrWqC3BVVaTLob4iCPR6I36mUxIUOpPJW7B_LjT78Qw,214
|
|
188
188
|
ultralytics/utils/callbacks/base.py,sha256=sOe3JvyBFmRwVZ8_Q03u7JwTeOOm9CI4s9-UEhnG0xA,5777
|
|
189
189
|
ultralytics/utils/callbacks/clearml.py,sha256=K7bDf5tS8xL4KeFMkoVDL2kKkil3f4qoKy8KfZkD854,5897
|
|
190
|
-
ultralytics/utils/callbacks/comet.py,sha256=
|
|
190
|
+
ultralytics/utils/callbacks/comet.py,sha256=QR3-9f0L_W7nZWWg_OEN7t8La2JotapSS-CnNYVjCdk,13744
|
|
191
191
|
ultralytics/utils/callbacks/dvc.py,sha256=WIClMsuvhiiyrwRv5BsZLxjsxYNJ3Y8Vq7zN0Bthtro,5045
|
|
192
192
|
ultralytics/utils/callbacks/hub.py,sha256=2xebyUL92j3OZwMmL80kdvHrMizqaaqXBe5oSXJRKdA,3621
|
|
193
|
-
ultralytics/utils/callbacks/mlflow.py,sha256=
|
|
193
|
+
ultralytics/utils/callbacks/mlflow.py,sha256=Wr5Kju9GFdwGJXJKvkPJDCZH6KiPF9EUxKPk08DBttY,5333
|
|
194
194
|
ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyzC5q7p4ipQ,3756
|
|
195
195
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
|
196
196
|
ultralytics/utils/callbacks/tensorboard.py,sha256=hRmWjbqdA4RNaLuSZznuDcpOBW-_-_Ga0u-B8UU-7ZI,4134
|
|
197
197
|
ultralytics/utils/callbacks/wb.py,sha256=4QI81nHdzgwhXHlmTiRxLqunvkKakLXYUhHTUY1ZeHA,6635
|
|
198
|
-
ultralytics-8.1.
|
|
199
|
-
ultralytics-8.1.
|
|
200
|
-
ultralytics-8.1.
|
|
201
|
-
ultralytics-8.1.
|
|
202
|
-
ultralytics-8.1.
|
|
203
|
-
ultralytics-8.1.
|
|
198
|
+
ultralytics-8.1.40.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
199
|
+
ultralytics-8.1.40.dist-info/METADATA,sha256=0oRr6J63TEFuDsb-EXJRA-0i2fPRJJ4MgBrbgq4s1B4,40330
|
|
200
|
+
ultralytics-8.1.40.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
201
|
+
ultralytics-8.1.40.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
202
|
+
ultralytics-8.1.40.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
203
|
+
ultralytics-8.1.40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|