# Ultralytics YOLO 🚀, AGPL-3.0 license # RT-DETR-ResNet50 object detection model with P3-P5 outputs. # Parameters nc: 3 nc_list: {'detection': 1, 'segmentation': 2} # number of classes scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n' # [depth, width, max_channels] l: [1.00, 1.00, 1024] backbone: # [from, repeats, module, args] 640 - [-1, 1, ResNetLayer, [3, 64, 1, True, 1]] # 0 320 - [-1, 1, ResNetLayer, [64, 64, 1, False, 3]] # 1 160 - [-1, 1, ResNetLayer, [256, 128, 2, False, 4]] # 2 80 - [-1, 1, ResNetLayer, [512, 256, 2, False, 6]] # 3 40 - [-1, 1, ResNetLayer, [1024, 512, 2, False, 3]] # 4 20 head: - [-1, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 5 - [-1, 1, AIFI, [1024, 8]] - [-1, 1, STB, [[20,20], 4, 4]] #6 JW here should add the correct resolution for stb, it is tuple. Second parameter is number of heads. Third is depth. - [-1, 1, Conv, [256, 1, 1]] # 7 - [-1, 1, nn.Upsample, [None, 2, "nearest"]] - [3, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 9 - [[-2, -1], 1, Concat, [1]] - [-1, 3, RepC3, [256]] # 11 - [-1, 1, Conv, [256, 1, 1]] # 12 - [-1, 1, nn.Upsample, [None, 2, "nearest"]] - [2, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 14 - [[-2, -1], 1, Concat, [1]] # cat backbone P4 - [-1, 3, RepC3, [256]] # X3 (16), fpn_blocks.1 - [-1, 1, Conv, [256, 3, 2]] # 17, downsample_convs.0 - [[-1, 13], 1, Concat, [1]] # cat Y4 - [-1, 3, RepC3, [256]] # F4 (19), pan_blocks.0 - [-1, 1, Conv, [256, 3, 2]] # 20, downsample_convs.1 - [[-1, 8], 1, Concat, [1]] # cat Y5 - [-1, 3, RepC3, [256]] # F5 (22), pan_blocks.1 - [[17, 20, 23], 1, MTDETRDecoder, [nc_list]] # Detect(P3, P4, P5)