from ultralytics import YOLO

# 1. 모델 로드 (YOLOv8m 사용)
model = YOLO('yolov8m.pt')

# 2. 학습 실행
# 위에서 생성된 yaml 파일 경로를 넣어줍니다.
# train_results = model.train(
#     data="/home/cuuva/experiment/datasets/fashionpedia_yolo/fashionpedia_custom_noface.yaml", 
#     epochs=500,            
#     imgsz=640,
#     batch=-1,              
#     device="cuda",
#     optimizer='AdamW',
#     lr0=0.001,
#     patience=50,
#     verbose=False,
#     project='fashionpedia_exp',
#     name='yolov8m_fashion_noface',
# )

train_results = model.train(
    data="/home/cuuva/git/Detection_Experiment/datasets/fashionpedia_yolo/fashionpedia_custom.yaml", 
    epochs=500,            
    imgsz=640,
    batch=-1,              
    device="cuda",
    optimizer='AdamW',
    lr0=0.001,
    patience=50,
    project='fashionpedia_exp',
    name='yolov8m_fashion_4class',
)