data_img / lib /models /__init__.py
sft2005's picture
Upload folder using huggingface_hub
9545fea verified
from .YOLOP import get_net as get_net_yolop
from .YOLOP_YOLOv11 import get_net_yolov11
def get_net(cfg, **kwargs):
"""
根据配置选择合适的模型
Args:
cfg: 配置对象
**kwargs: 额外参数(用于 YOLOv11)
"""
if hasattr(cfg.MODEL, 'USE_YOLOV11') and cfg.MODEL.USE_YOLOV11:
return get_net_yolov11(cfg, **kwargs)
else:
return get_net_yolop(cfg, **kwargs)