Fix model names docstring type to dict (#15726)
Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
This commit is contained in:
parent
98a39f594c
commit
5f93df6fca
2 changed files with 9 additions and 9 deletions
|
|
@ -900,7 +900,7 @@ class Model(nn.Module):
|
|||
initialized, it sets it up before retrieving the names.
|
||||
|
||||
Returns:
|
||||
(List[str]): A list of class names associated with the model.
|
||||
(Dict[int, str]): A dict of class names associated with the model.
|
||||
|
||||
Raises:
|
||||
AttributeError: If the model or predictor does not have a 'names' attribute.
|
||||
|
|
@ -908,7 +908,7 @@ class Model(nn.Module):
|
|||
Examples:
|
||||
>>> model = YOLO('yolov8n.pt')
|
||||
>>> print(model.names)
|
||||
['person', 'bicycle', 'car', ...]
|
||||
{0: 'person', 1: 'bicycle', 2: 'car', ...}
|
||||
"""
|
||||
from ultralytics.nn.autobackend import check_class_names
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue