mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-23 02:36: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.
1.5 KiB
1.5 KiB
Module: dataset-visualiser
Purpose
Interactive tool for visually inspecting annotated images from datasets or the processed folder, displaying bounding boxes with class colors.
Public Interface
| Function | Signature | Description |
|---|---|---|
visualise_dataset |
() |
Iterates images in a specific dataset folder, shows each with annotations. Waits for keypress. |
visualise_processed_folder |
() |
Shows images from the processed folder with annotations. |
Internal Logic
- visualise_dataset(): Hardcoded to a specific dataset date (
2024-06-18), iterates from index 35247 onward. Reads image + labels, callsImageLabel.visualize(), waits for user input to advance. - visualise_processed_folder(): Lists all processed images, shows the first one.
- Both functions use
read_labels()imported from apreprocessingmodule which does not exist in the codebase — this is a broken import.
Dependencies
constants— directory paths (datasets_dir, prefix, processed_*)dto/annotationClass— AnnotationClass for class colorsdto/imageLabel— ImageLabel for visualizationpreprocessing— MISSING MODULE (read_labels function)cv2(external),matplotlib(external),os,pathlib(stdlib)
Consumers
None (standalone script).
Data Models
Uses ImageLabel, AnnotationClass.
Configuration
Hardcoded dataset path and start index.
External Integrations
Filesystem I/O, matplotlib interactive display.
Security
None.
Tests
None.