Files
zjsh_yolov11/ultralytics_yolo11-main/train_point_main.py
琉璃月光 254afbbc43 修改
2025-08-14 18:24:45 +08:00

22 lines
633 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from ultralytics import YOLO
if __name__ == '__main__':
# ✅ 使用官方支持的关键点模型YOLOv11
model = YOLO(r'ultralytics/cfg/models/11/yolo11-pose.yaml') # 或
results = model.train(
data='point_data.yaml',
imgsz=1280,
epochs=100,
batch=4,
workers=10,
device='0',
project='runs/train',
name='exp_pose',
exist_ok=False,
optimizer='AdamW',
lr0=0.001,
patience=20,
# ✅ 关键:指定关键点数量
#kpt_shape=[4, 3], # [数量, 坐标维度],您的任务是 4 个关键点 (x,y)
)