ultralytics 8.0.21 Windows, segments, YAML fixes (#655)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: corey-nm <109536191+corey-nm@users.noreply.github.com>
This commit is contained in:
parent
dc9502c700
commit
6c44ce21d9
16 changed files with 147 additions and 146 deletions
|
|
@ -61,8 +61,8 @@ class YOLO:
|
|||
else:
|
||||
raise NotImplementedError(f"'{suffix}' model loading not implemented")
|
||||
|
||||
def __call__(self, source=None, stream=False, verbose=False, **kwargs):
|
||||
return self.predict(source, stream, verbose, **kwargs)
|
||||
def __call__(self, source=None, stream=False, **kwargs):
|
||||
return self.predict(source, stream, **kwargs)
|
||||
|
||||
def _new(self, cfg: str, verbose=True):
|
||||
"""
|
||||
|
|
@ -118,7 +118,7 @@ class YOLO:
|
|||
self.model.fuse()
|
||||
|
||||
@smart_inference_mode()
|
||||
def predict(self, source=None, stream=False, verbose=False, **kwargs):
|
||||
def predict(self, source=None, stream=False, **kwargs):
|
||||
"""
|
||||
Perform prediction using the YOLO model.
|
||||
|
||||
|
|
@ -126,7 +126,6 @@ class YOLO:
|
|||
source (str | int | PIL | np.ndarray): The source of the image to make predictions on.
|
||||
Accepts all source types accepted by the YOLO model.
|
||||
stream (bool): Whether to stream the predictions or not. Defaults to False.
|
||||
verbose (bool): Whether to print verbose information or not. Defaults to False.
|
||||
**kwargs : Additional keyword arguments passed to the predictor.
|
||||
Check the 'configuration' section in the documentation for all available options.
|
||||
|
||||
|
|
@ -143,7 +142,7 @@ class YOLO:
|
|||
self.predictor.setup_model(model=self.model)
|
||||
else: # only update args if predictor is already setup
|
||||
self.predictor.args = get_cfg(self.predictor.args, overrides)
|
||||
return self.predictor(source=source, stream=stream, verbose=verbose)
|
||||
return self.predictor(source=source, stream=stream)
|
||||
|
||||
@smart_inference_mode()
|
||||
def val(self, data=None, **kwargs):
|
||||
|
|
@ -234,7 +233,8 @@ class YOLO:
|
|||
"""
|
||||
return self.model.names
|
||||
|
||||
def add_callback(self, event: str, func):
|
||||
@staticmethod
|
||||
def add_callback(event: str, func):
|
||||
"""
|
||||
Add callback
|
||||
"""
|
||||
|
|
@ -242,16 +242,8 @@ class YOLO:
|
|||
|
||||
@staticmethod
|
||||
def _reset_ckpt_args(args):
|
||||
args.pop("project", None)
|
||||
args.pop("name", None)
|
||||
args.pop("exist_ok", None)
|
||||
args.pop("resume", None)
|
||||
args.pop("batch", None)
|
||||
args.pop("epochs", None)
|
||||
args.pop("cache", None)
|
||||
args.pop("save_json", None)
|
||||
args.pop("half", None)
|
||||
args.pop("v5loader", None)
|
||||
for arg in 'verbose', 'project', 'name', 'exist_ok', 'resume', 'batch', 'epochs', 'cache', 'save_json', \
|
||||
'half', 'v5loader':
|
||||
args.pop(arg, None)
|
||||
|
||||
# set device to '' to prevent from auto DDP usage
|
||||
args["device"] = ''
|
||||
args["device"] = '' # set device to '' to prevent auto-DDP usage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue