import glob
import os
import shutil
from os import path

import constants
import train

# train.train_dataset()
# train.resume_training('/azaion/dev/ai-training/runs/detect/train12/weights/last.pt')

model_dir = path.join(constants.config.models_dir, f'{constants.prefix}2025-05-18')

for file in glob.glob(path.join(model_dir, 'weights', 'epoch*')):
    os.remove(file)
shutil.copy(path.join(model_dir, 'weights', 'best.pt'), constants.config.current_pt_model)

train.export_current_model()
print('success!')