14 lines
378 B
Python
14 lines
378 B
Python
from ultralytics import RTDETR
|
|
|
|
def trsinRTDETR():
|
|
# 加载预训练的RT-DETR-x模型
|
|
model = RTDETR("rtdetr-x.pt")
|
|
# 显示模型信息(可选)
|
|
|
|
model.info()
|
|
|
|
# 在COCO8示例数据集上训练模型100个epoch
|
|
results = model.train(data="coco8.yaml", epochs=500, imgsz=1700, batch=6, device=[0, 1, 2], patience=0)
|
|
|
|
if __name__ == '__main__':
|
|
trsinRTDETR() |