ultralytics 8.0.39
add ByteTracker and BoT-SORT trackers and fixes (#984)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -45,8 +45,6 @@ class YOLODataset(BaseDataset):
|
||||
|
||||
def cache_labels(self, path=Path("./labels.cache")):
|
||||
# Cache dataset labels, check images and read shapes
|
||||
if path.exists():
|
||||
path.unlink() # remove *.cache file if exists
|
||||
x = {"labels": []}
|
||||
nm, nf, ne, nc, msgs = 0, 0, 0, 0, [] # number missing, found, empty, corrupt, messages
|
||||
desc = f"{self.prefix}Scanning {path.parent / path.stem}..."
|
||||
@ -86,11 +84,13 @@ class YOLODataset(BaseDataset):
|
||||
x["msgs"] = msgs # warnings
|
||||
x["version"] = self.cache_version # cache version
|
||||
if is_dir_writeable(path.parent):
|
||||
if path.exists():
|
||||
path.unlink() # remove *.cache file if exists
|
||||
np.save(str(path), x) # save cache for next time
|
||||
path.with_suffix(".cache.npy").rename(path) # remove .npy suffix
|
||||
LOGGER.info(f"{self.prefix}New cache created: {path}")
|
||||
else:
|
||||
LOGGER.warning(f"{self.prefix}WARNING ⚠️ Cache directory {path.parent} is not writeable") # not writeable
|
||||
LOGGER.warning(f"{self.prefix}WARNING ⚠️ Cache directory {path.parent} is not writeable, cache not saved.")
|
||||
return x
|
||||
|
||||
def get_labels(self):
|
||||
|
@ -101,6 +101,7 @@ class YOLO:
|
||||
self.model, self.ckpt = weights, None
|
||||
self.task = guess_model_task(weights)
|
||||
self.ckpt_path = weights
|
||||
self.overrides['model'] = weights
|
||||
self.ModelClass, self.TrainerClass, self.ValidatorClass, self.PredictorClass = self._assign_ops_from_task()
|
||||
|
||||
def _check_is_pytorch_model(self):
|
||||
|
@ -184,7 +184,7 @@ class BaseTrainer:
|
||||
finally:
|
||||
ddp_cleanup(self, file)
|
||||
else:
|
||||
self._do_train(int(os.getenv("RANK", -1)), world_size)
|
||||
self._do_train(RANK, world_size)
|
||||
|
||||
def _setup_ddp(self, rank, world_size):
|
||||
# os.environ['MASTER_ADDR'] = 'localhost'
|
||||
|
Reference in New Issue
Block a user