From 95368cbe54ba0767e7fd8504e417f5be8e87b544 Mon Sep 17 00:00:00 2001 From: Kilian Schnelle <57074573+KiSchnelle@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:19:46 +0100 Subject: [PATCH] Changed model.names return type hint from list to dict[int, str] (#17402) --- ultralytics/engine/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ultralytics/engine/model.py b/ultralytics/engine/model.py index c5b63eed..71817672 100644 --- a/ultralytics/engine/model.py +++ b/ultralytics/engine/model.py @@ -2,7 +2,7 @@ import inspect from pathlib import Path -from typing import List, Union +from typing import Dict, List, Union import numpy as np import torch @@ -881,7 +881,7 @@ class Model(nn.Module): return self @property - def names(self) -> list: + def names(self) -> Dict[int, str]: """ Retrieves the class names associated with the loaded model.