mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 08:56:35 +00:00
142c6c4de8
- Replaced module-level path variables in constants.py with a structured Pydantic Config class. - Updated all relevant modules (train.py, augmentation.py, exports.py, dataset-visualiser.py, manual_run.py) to access paths through the new config structure. - Fixed bugs related to image processing and model saving. - Enhanced test infrastructure to accommodate the new configuration approach. This refactor improves code maintainability and clarity by centralizing configuration management.
21 lines
584 B
Python
21 lines
584 B
Python
import glob
|
|
import os
|
|
import shutil
|
|
from os import path
|
|
|
|
import constants
|
|
import train
|
|
from augmentation import Augmentator
|
|
|
|
# Augmentator().augment_annotations()
|
|
# 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!') |