İçeriğe geç

Referans için ultralytics/models/rtdetr/model.py

Not

Bu dosya https://github.com/ultralytics/ultralytics/blob/main/ ultralytics/models/rtdetr/model .py adresinde mevcuttur. Bir sorun tespit ederseniz lütfen bir Çekme İsteği 🛠️ ile katkıda bulunarak düzeltilmesine yardımcı olun. Teşekkürler 🙏!



ultralytics.models.rtdetr.model.RTDETR

Üsler: Model

Baidu'nun RT-DETR modeli için arayüz. Bu Vision Transformer tabanlı nesne algılayıcı, gerçek zamanlı performans sağlar yüksek doğrulukla. Verimli hibrit kodlamayı, IoU farkındalı sorgu seçimini ve uyarlanabilir çıkarım hızını destekler.

Nitelikler:

İsim Tip Açıklama
model str

Önceden eğitilmiş modelin yolu. Varsayılan değer 'rtdetr-l.pt'.

Kaynak kodu 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

Görevleri karşılık gelen Ultralytics sınıflarıyla ilişkilendirerek RT-DETR için bir görev haritası döndürür.

İade:

İsim Tip Açıklama
dict dict

RT-DETR modeli için görev adlarını Ultralytics görev sınıflarıyla eşleyen bir sözlük.

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

RT-DETR modelini verilen önceden eğitilmiş model dosyası ile başlatır. .pt ve .yaml biçimlerini destekler.

Parametreler:

İsim Tip Açıklama Varsayılan
model str

Önceden eğitilmiş modelin yolu. Varsayılan değer 'rtdetr-l.pt'.

'rtdetr-l.pt'

Zamlar:

Tip Açıklama
NotImplementedError

Model dosyası uzantısı 'pt', 'yaml' veya 'yml' değilse.

Kaynak kodu 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")





Oluşturuldu 2023-11-12, Güncellendi 2024-05-08
Yazarlar: Burhan-Q (1), glenn-jocher (3)