Bỏ để qua phần nội dung

Tài liệu tham khảo cho ultralytics/models/rtdetr/model.py

Ghi

Tệp này có sẵn tại https://github.com/ultralytics/ultralytics/blob/main/ultralytics/mô hình/rtdetr/model.py. Nếu bạn phát hiện ra một vấn đề, vui lòng giúp khắc phục nó bằng cách đóng góp Yêu cầu 🛠️ kéo. Cảm ơn bạn 🙏 !



ultralytics.models.rtdetr.model.RTDETR

Căn cứ: Model

Giao diện cho Baidu's RT-DETR mẫu. Máy dò đối tượng dựa trên Vision Transformer này cung cấp hiệu suất thời gian thực với độ chính xác cao. Nó hỗ trợ mã hóa kết hợp hiệu quả, lựa chọn truy vấn nhận biết IoT và tốc độ suy luận thích ứng.

Thuộc tính:

Tên Kiểu Sự miêu tả
model str

Đường dẫn đến mô hình được đào tạo trước. Mặc định là 'rtdetr-l.pt'.

Mã nguồn trong 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

Trả về bản đồ nhiệm vụ cho RT-DETR, liên kết các nhiệm vụ với tương ứng Ultralytics Lớp học.

Trở lại:

Tên Kiểu Sự miêu tả
dict dict

Từ điển ánh xạ tên nhiệm vụ tới Ultralytics Các lớp nhiệm vụ cho RT-DETR mẫu.

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

Khởi tạo các RT-DETR mô hình với tệp mô hình được đào tạo trước đã cho. Hỗ trợ các định dạng .pt và .yaml.

Thông số:

Tên Kiểu Sự miêu tả Mặc định
model str

Đường dẫn đến mô hình được đào tạo trước. Mặc định là 'rtdetr-l.pt'.

'rtdetr-l.pt'

Tăng:

Kiểu Sự miêu tả
NotImplementedError

Nếu phần mở rộng tệp mô hình không phải là 'pt', 'yaml' hoặc 'yml'.

Mã nguồn trong 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")





Đã tạo 2023-11-12, Cập nhật 2024-05-08
Tác giả: Burhan-Q (1), glenn-jocher (3)