Skip to content

Commit a6ca6e9

Browse files
committed
Refactor AIManager to use ModelManager for model handling
This commit introduces a new `ModelManager` class to encapsulate model-related properties and methods, improving code organization and separation of concerns. Key properties such as `IMAGE_SIZE`, `NUM_DETECTIONS`, and others have been moved to `ModelManager`. The `LoadModelAsync` method now accepts an `IMAGE_SIZE` parameter for better validation and detection calculation. Event subscriptions for `ClassesUpdated` and `ImageSizeUpdated` have been updated to reference `ModelManager`. The `LoadClasses` method has been modified for better class management, and a `Dispose` method has been added to handle resource cleanup. Additionally, the `CalculateNumDetections` method has been relocated to `MathUtil`, and the code has been cleaned up for improved readability. Refactor AIManager to use ModelManager for better structure This commit introduces a new `ModelManager` class to encapsulate model-related properties and methods, improving code organization and separation of concerns. Key changes include: - Migration of model loading, validation, and class management from `AIManager` to `ModelManager`. - Updates to event handling for model classes and image size notifications. - Relocation of the `CalculateNumDetections` method to `MathUtil` as a public static method. - Simplification of the `AIManager` class by removing redundant properties and methods. - Refinement of sticky aim logic for better target handling. - Enhanced error handling and logging during model loading. These changes enhance maintainability, readability, and functionality related to model management and AI processing.
1 parent 856e10a commit a6ca6e9

File tree

4 files changed

+420
-348
lines changed

4 files changed

+420
-348
lines changed

0 commit comments

Comments
 (0)