Skip to content

Feat/new dataset class - #62

Merged
Lucashsmello merged 58 commits into
mainfrom
feat/new-dataset-class
Apr 6, 2026
Merged

Feat/new dataset class#62
Lucashsmello merged 58 commits into
mainfrom
feat/new-dataset-class

Conversation

@Lucashsmello

Copy link
Copy Markdown
Collaborator

This pull request introduces several enhancements and refactorings across the datamint package, focusing on improved API usability, modular dataset support, and better error handling. The most significant changes include new convenience methods for working with annotation specs, improved project creation logic, and enhancements to dataset modularity and serialization.

API Improvements and Annotation Handling:

  • Added methods to AnnotationSetsApi and ProjectsApi for retrieving annotation specifications directly from annotation sets or projects, streamlining workflows that require annotation metadata. [1] [2]
  • Enhanced ProjectsApi.create() to support an exists_ok parameter, allowing the method to return an existing project instead of raising an error if a project with the same name already exists. [1] [2] [3] [4] [5]

Dataset Modularity and API Initialization:

  • Updated datamint/__init__.py to support modular dataset classes (ImageDataset, VolumeDataset) and clarified legacy vs. new exports for easier future maintenance and usage.

Inference and Model Deployment Enhancements:

  • Improved error handling in DeployModelApi.get_by_id() by validating UUIDs and providing more informative exceptions.
  • Refined InferenceApi.wait() to update the provided InferenceJob in-place and improved the notification mechanism for job status updates. Also, aliased predict to submit for consistency. [1] [2] [3]

Serialization and DTO Clean-up:

  • Added __getstate__ and __setstate__ methods to Api for improved serialization and deserialization support, which is useful for pickling or distributed settings.
  • Cleaned up DTO exports to remove duplicates and ensure correct listing.

Format Detection:

  • Improved the fallback logic for MIME type detection and error handling for empty files. [1] [2] [3] [4]

These changes collectively improve the robustness, usability, and maintainability of the datamint codebase.

…; deprecate legacy DatamintBaseDataset and DatamintDataset
…es; add AnnotationSpec model and enhance Dataset classes for improved annotation handling
… better dataset initialization and state management
…odelLoader and implement prediction routing with PredictionRouter

- Moved model lifecycle management logic from DatamintModel to LinkedModelLoader for better separation of concerns.
- Introduced PredictionRouter to handle prediction mode dispatching, replacing the previous hardcoded method.
- Updated DatamintModel to utilize the new LinkedModelLoader and PredictionRouter for improved maintainability and clarity.
- Introduced BaseDatamintModel to encapsulate common functionality for MLflow models.
- Added PredictionMode enumeration for better management of prediction modes.
- Enhanced LinkedModelLoader to separate device management from model loading.
- Updated DatamintModel to utilize the new base class and improved loading context.
- Implemented a new prediction router for dynamic dispatching based on prediction modes.
- Refactored MLFlowModelCheckpoint to support multiple flavors and improved signature inference.
- Added MLFlowDatamintModelCheckpoint for specific integration with Datamint models.
- Updated version to 2.12.0a0 in pyproject.toml.
- Added MLflow project context management in BaseTrainer.
- Implemented experiment name generation based on user project.
- Introduced per-sample metrics logging in DatamintLightningModule for classification and segmentation tasks.
- Enhanced loss computation methods to support per-sample loss for better metric accuracy.
- Updated model checkpointing to log additional metadata and support retrieval of logged models.
- Improved dataset logging during training and testing phases.
- Refactored callback structure to streamline MLflow integration and metrics logging.
- Added validation for class names and number of classes in SegmentationModule.
- Enhanced logging and error handling throughout the training and logging processes.
- Add persistent workers to DataModule for improved performance.
- Introduce logging for training and testing phases in BaseTrainer.
- Implement deferred sample metrics collection in DatamintLightningModule.
- Update classification and segmentation modules to check for loss function reduction support.
- Improve model logging in MLFlow with thread-safe handling and CPU copies.
…and enhance BaseSegmentationAnnotation constructor for better mask handling
@Lucashsmello
Lucashsmello merged commit 9f03c23 into main Apr 6, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant