Files
ai-training/_docs/02_document/modules/constants.md
T
Oleksandr Bezdieniezhnykh 142c6c4de8 Refactor constants management to use Pydantic BaseModel for configuration
- 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.
2026-03-27 18:18:30 +02:00

2.0 KiB

Module: constants

Purpose

Centralizes all filesystem path constants, config file names, file extensions, and size thresholds used across the training pipeline.

Public Interface

Name Type Value/Description
azaion str Root directory: /azaion
prefix str Naming prefix: azaion-
data_dir str /azaion/data
data_images_dir str /azaion/data/images
data_labels_dir str /azaion/data/labels
processed_dir str /azaion/data-processed
processed_images_dir str /azaion/data-processed/images
processed_labels_dir str /azaion/data-processed/labels
corrupted_dir str /azaion/data-corrupted
corrupted_images_dir str /azaion/data-corrupted/images
corrupted_labels_dir str /azaion/data-corrupted/labels
sample_dir str /azaion/data-sample
datasets_dir str /azaion/datasets
models_dir str /azaion/models
date_format str %Y-%m-%d
checkpoint_file str checkpoint.txt
checkpoint_date_format str %Y-%m-%d %H:%M:%S
CONFIG_FILE str config.yaml
JPG_EXT str .jpg
TXT_EXT str .txt
OFFSET_FILE str offset.yaml
SMALL_SIZE_KB int 3 (KB threshold for split-upload small part)
CDN_CONFIG str cdn.yaml
MODELS_FOLDER str models
CURRENT_PT_MODEL str /azaion/models/azaion.pt
CURRENT_ONNX_MODEL str /azaion/models/azaion.onnx

Internal Logic

Pure constant definitions using os.path.join. No functions, no classes, no dynamic behavior.

Dependencies

  • os.path (stdlib)

Consumers

api_client, augmentation, exports, train, manual_run, start_inference, dataset-visualiser

Data Models

None.

Configuration

Defines CONFIG_FILE = 'config.yaml' and CDN_CONFIG = 'cdn.yaml' — the filenames for runtime configuration. Does not read them.

External Integrations

None.

Security

None.

Tests

None.