mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 12:46:36 +00:00
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.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# 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, calls `ImageLabel.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 a `preprocessing` module **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 colors
|
||||
- `dto/imageLabel` — ImageLabel for visualization
|
||||
- `preprocessing` — **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.
|
||||
Reference in New Issue
Block a user