انتقل إلى المحتوى

مرجع ل ultralytics/models/rtdetr/model.py

ملاحظه

هذا الملف متاح في https://github.com/ultralytics/ultralytics/ نقطة / الرئيسية /ultralytics/نماذج/rtdetr/model.py. إذا اكتشفت مشكلة ، فيرجى المساعدة في إصلاحها من خلال المساهمة في طلب 🛠️ سحب. شكرا لك 🙏!



ultralytics.models.rtdetr.model.RTDETR

قواعد: Model

واجهة لبايدو RT-DETR نموذج. يوفر كاشف الأجسام المستند إلى Vision Transformer أداء في الوقت الفعلي بدقة عالية. وهو يدعم الترميز المختلط الفعال ، واختيار الاستعلام المدرك لإنترنت الأشياء ، وسرعة الاستدلال القابلة للتكيف.

سمات:

اسم نوع وصف
model str

الطريق إلى النموذج المدرب مسبقا. الإعدادات الافتراضية هي "rtdetr-l.pt".

شفرة المصدر في 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

إرجاع خريطة مهام ل RT-DETR، وربط المهام مع المقابلة Ultralytics فئات.

ارجاع:

اسم نوع وصف
dict dict

تعيين قاموس أسماء المهام إلى Ultralytics فئات المهام ل RT-DETR نموذج.

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

تهيئة RT-DETR نموذج مع ملف النموذج المدرب مسبقا. يدعم تنسيقات .pt و .yaml.

البارامترات:

اسم نوع وصف افتراضي
model str

الطريق إلى النموذج المدرب مسبقا. الإعدادات الافتراضية هي "rtdetr-l.pt".

'rtdetr-l.pt'

يثير:

نوع وصف
NotImplementedError

إذا لم يكن امتداد ملف النموذج "pt" أو "yaml" أو "yml".

شفرة المصدر في 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")





تم الإنشاء 2023-11-12، تم التحديث 2024-05-08
المؤلفون: برهان-Q (1)، جلين-جوتشر (3)