I am exploring waste detection and I want to replace the C3k2 blocks in the YOLO11 backbone with RepViT modules, while keeping the original YOLO11 neck and detection head.
My main goal is to reuse the pretrained weights from both RepViT and YOLO11. Specifically, I would like to load the pretrained ImageNet weights for the RepViT modules and reuse the pretrained YOLO11 weights for the compatible parts of the neck and detection head, rather than training the entire model from scratch.
What is the recommended way to implement this modification in the current Ultralytics framework?
Specifically:
-
Where should I define the RepViT module?
-
How should I register it so it can be used in the YAML?
-
How should I handle the different feature-map channels and strides between the RepViT modules and the original C3k2 blocks?
-
Can I load the pretrained ImageNet weights into the RepViT modules while simultaneously reusing the compatible pretrained YOLO11 weights for the neck and detection head?
-
If replacing C3k2 with RepViT causes channel or tensor-shape mismatches in the YOLO11 neck, what is the recommended way to handle them?
-
Is there a recommended YAML structure for replacing the C3k2 blocks with RepViT while preserving the rest of the YOLO11 architecture?