import os

os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'

from ultralytics import YOLO
from ultralytics import settings


if __name__ == '__main__':
    settings.update({'wandb': False})
    # model_path = 'D:\\train_cad_detection\\runs\\segment\\train4\\weights\\best.pt'
    model = YOLO('yolov8l-seg.yaml')#.load(model_path)
    results = model.train(data='cad_seg.yaml', mask_ratio=1, overlap_mask=False, epochs=60, save_period=10, imgsz=512, mosaic=0, translate=0, scale=0,
                          erasing=0, hsv_h=0, hsv_s=0, hsv_v=0, degrees=0, flipud=0.5, fliplr=0.5,batch=32, device=[1])
    model.export(format='onnx')
