Zum Inhalt springen

Referenz fĂŒr ultralytics/models/rtdetr/model.py

Hinweis

Diese Datei ist verfĂŒgbar unter https://github.com/ultralytics/ ultralytics/blob/main/ ultralytics/models/rtdetr/model .py. Wenn du ein Problem entdeckst, hilf bitte mit, es zu beheben, indem du einen Pull Request đŸ› ïž einreichst. Vielen Dank 🙏!



ultralytics.models.rtdetr.model.RTDETR

Basen: Model

Schnittstelle fĂŒr das Modell RT-DETR von Baidu. Dieser auf Vision Transformer basierende Objektdetektor bietet Echtzeitleistung mit hoher Genauigkeit. Er unterstĂŒtzt eine effiziente hybride Kodierung, eine IoU-bezogene Abfrageauswahl und eine anpassbare Inferenzgeschwindigkeit.

Attribute:

Name Typ Beschreibung
model str

Pfad zum vortrainierten Modell. Der Standardwert ist "rtdetr-l.pt".

Quellcode in ultralytics/models/rtdetr/model.py
class RTDETR(Model):
    """
    Interface for Baidu's RT-DETR model. This Vision Transformer-based object detector provides real-time performance
    with high accuracy. It supports efficient hybrid encoding, IoU-aware query selection, and adaptable inference speed.

    Attributes:
        model (str): Path to the pre-trained model. Defaults to 'rtdetr-l.pt'.
    """

    def __init__(self, model="rtdetr-l.pt") -> None:
        """
        Initializes the RT-DETR model with the given pre-trained model file. Supports .pt and .yaml formats.

        Args:
            model (str): Path to the pre-trained model. Defaults to 'rtdetr-l.pt'.

        Raises:
            NotImplementedError: If the model file extension is not 'pt', 'yaml', or 'yml'.
        """
        super().__init__(model=model, task="detect")

    @property
    def task_map(self) -> dict:
        """
        Returns a task map for RT-DETR, associating tasks with corresponding Ultralytics classes.

        Returns:
            dict: A dictionary mapping task names to Ultralytics task classes for the RT-DETR model.
        """
        return {
            "detect": {
                "predictor": RTDETRPredictor,
                "validator": RTDETRValidator,
                "trainer": RTDETRTrainer,
                "model": RTDETRDetectionModel,
            }
        }

task_map: dict property

Gibt eine Aufgabenkarte fĂŒr RT-DETR zurĂŒck, die Aufgaben mit den entsprechenden Ultralytics Klassen verbindet.

Retouren:

Name Typ Beschreibung
dict dict

Ein Wörterbuch, das die Aufgabennamen den Ultralytics Aufgabenklassen fĂŒr das RT-DETR Modell zuordnet.

__init__(model='rtdetr-l.pt')

Initialisiert das Modell RT-DETR mit der angegebenen vortrainierten Modelldatei. UnterstĂŒtzt die Formate .pt und .yaml.

Parameter:

Name Typ Beschreibung Standard
model str

Pfad zum vortrainierten Modell. Der Standardwert ist "rtdetr-l.pt".

'rtdetr-l.pt'

Erhöht:

Typ Beschreibung
NotImplementedError

Wenn die Erweiterung der Modelldatei nicht "pt", "yaml" oder "yml" lautet.

Quellcode in ultralytics/models/rtdetr/model.py
def __init__(self, model="rtdetr-l.pt") -> None:
    """
    Initializes the RT-DETR model with the given pre-trained model file. Supports .pt and .yaml formats.

    Args:
        model (str): Path to the pre-trained model. Defaults to 'rtdetr-l.pt'.

    Raises:
        NotImplementedError: If the model file extension is not 'pt', 'yaml', or 'yml'.
    """
    super().__init__(model=model, task="detect")





Erstellt am 2023-11-12, Aktualisiert am 2024-05-08
Autoren: Burhan-Q (1), glenn-jocher (3)