-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/mlflow inference #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces segmentation annotation support for 2D images and 3D volumes, refactors caching to use lazy initialization for better memory efficiency, and simplifies the MLflow flavor integration by removing unused parameters and improving error handling.
- Added
ImageSegmentationandVolumeSegmentationclasses with factory methods for creating segmentation annotations from numpy arrays and NIfTI images - Refactored
_cacheinAnnotationandResourceclasses to use lazy property-based initialization - Updated MLflow flavor API to remove unused parameters (
example_no_conversion,conda_env,streamable) and renamedartifact_pathtoname
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| datamint/entities/annotations/image_segmentation.py | New 2D segmentation annotation class with mask validation and utility methods |
| datamint/entities/annotations/volume_segmentation.py | New 3D volume segmentation annotation class supporting semantic segmentation with class maps |
| datamint/entities/annotations/init.py | Exports new segmentation annotation classes |
| datamint/entities/annotations/annotation.py | Refactored _cache to use lazy property initialization instead of eager initialization |
| datamint/entities/resource.py | Refactored _cache to use lazy property and removed redundant _cache = None assignments |
| datamint/mlflow/flavors/datamint_flavor.py | Removed unused parameters and changed artifact_path to name, updated import for Python 3.10+ compatibility |
| datamint/mlflow/flavors/model.py | Refactored cached attributes cleanup to use a centralized list pattern |
| datamint/mlflow/lightning/callbacks/modelcheckpoint.py | Improved model URI restoration with search_logged_models, added error handling for signature updates, removed debug logs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces two new annotation entity classes for segmentation tasks (2D and 3D), refactors caching to use lazy initialization for resource and annotation entities, and cleans up the MLflow flavor integration by removing unused or redundant arguments. These changes improve support for segmentation workflows and enhance code maintainability.
Segmentation annotation support:
ImageSegmentationclass for 2D image segmentation annotations, including methods for mask validation, conversion, and area calculation (datamint/entities/annotations/image_segmentation.py,datamint/entities/annotations/__init__.py). [1] [2]VolumeSegmentationclass for 3D volume segmentation annotations, supporting both semantic and instance segmentation with class mapping and validation (datamint/entities/annotations/volume_segmentation.py,datamint/entities/annotations/__init__.py). [1] [2]Caching improvements:
_cacheinitialization in bothAnnotationandResourceclasses to use a property with lazy instantiation, improving memory usage and avoiding unnecessary cache creation (datamint/entities/annotations/annotation.py,datamint/entities/resource.py). [1] [2]_cachetoNonein various code paths inResourceto simplify logic (datamint/entities/resource.py). [1] [2] [3]MLflow flavor integration cleanup:
example_no_conversion,conda_env, andstreamablefrom MLflow flavor API, and refactored argument names for clarity (e.g.,artifact_pathtoname) (datamint/mlflow/flavors/datamint_flavor.py). [1] [2] [3] [4]Sequenceto usecollections.abcfor Python 3.10+ compatibility (datamint/mlflow/flavors/datamint_flavor.py).Minor cleanup:
model.py(datamint/mlflow/flavors/model.py).