mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 21:56:36 +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.
1.6 KiB
1.6 KiB
Test Data Management
Fixture Sources
| ID | Data Item | Source | Format | Preparation |
|---|---|---|---|---|
| FD-01 | Annotated images (100) | _docs/00_problem/input_data/dataset/images/ |
JPEG | Copy subset to tmp_path at test start |
| FD-02 | YOLO labels (100) | _docs/00_problem/input_data/dataset/labels/ |
TXT | Copy subset to tmp_path at test start |
| FD-03 | ONNX model | _docs/00_problem/input_data/azaion.onnx |
ONNX | Read bytes at test start |
| FD-04 | Class definitions | classes.json (project root) |
JSON | Copy to tmp_path at test start |
| FD-05 | Corrupted labels | Generated at test time | TXT | Create labels with coords > 1.0 |
| FD-06 | Edge-case bboxes | Generated at test time | In-memory | Construct bboxes near image boundaries |
| FD-07 | Detection objects | Generated at test time | In-memory | Construct Detection instances for NMS tests |
| FD-08 | Msgpack messages | Generated at test time | bytes | Construct AnnotationMessage-compatible msgpack |
| FD-09 | Random binary data | Generated at test time | bytes | os.urandom(N) for encryption tests |
| FD-10 | Empty label file | Generated at test time | TXT | Empty file for augmentation edge case |
Data Lifecycle
- Setup: pytest
conftest.pycopies fixture files totmp_path - Execution: Tests operate on copied data in isolation
- Teardown:
tmp_pathis automatically cleaned by pytest
Expected Results Location
All expected results are defined in _docs/00_problem/input_data/expected_results/results_report.md (37 test scenarios mapped).