Version 1.6.1 (2025-12-22)
🔧 Plugin Schema Versioning and ML-Ready Architecture
Version 1.6.1 introduces schema versioning for detector plugin contracts and multi-framework image support, laying the groundwork for ML-based detectors in v2.x.
Highlights
- Schema versioning:
DetectionContextandDetectionResultnow includeschema_versionfield - Multi-framework images: New
ImageLiketype supports numpy, PyTorch, and PIL - Enhanced diagnostics:
DetectionResult.metricsfor standardized performance metrics - Serialization support:
DetectionResult.to_dict()for JSON-compatible output
Why This Change?
This release prepares the plugin architecture for:
- Future schema migrations: Version field enables gradual migration without breaking existing plugins
- ML detector support:
ImageLiketype allows detectors to work with PyTorch tensors natively - Standardized metrics: Consistent diagnostics across different detector implementations
Schema Changes
DetectionContext (v1.6.1):
@dataclass
class DetectionContext:
current_image: ImageLike # NEW: Union[np.ndarray, torch.Tensor, PIL.Image]
previous_image: ImageLike # NEW: Union[np.ndarray, torch.Tensor, PIL.Image]
roi_mask: Any
runtime_params: Dict[str, Any]
metadata: Dict[str, Any]
schema_version: int = 1 # NEW: For migration supportDetectionResult (v1.6.1):
@dataclass
class DetectionResult:
is_candidate: bool
score: float
lines: List[Tuple[int, int, int, int]]
aspect_ratio: float
debug_image: Optional[Any]
extras: Dict[str, Any]
metrics: Dict[str, Any] # NEW: Standard diagnostics
schema_version: int = 1 # NEW: For migration support
def to_dict(self) -> Dict[str, Any]: # NEW: Serialization
...New Utility Functions
ensure_numpy() in meteor_core.utils:
from meteor_core.utils import ensure_numpy
# Convert any ImageLike to numpy array
image = ensure_numpy(context.current_image) # Works with numpy, torch, PILMigration Guide for Plugin Authors
No migration required. Existing plugins work without modification.
Optional enhancements:
- Use
ensure_numpy()for type-safe image handling - Populate
metricsdict with standard diagnostics - Use
result.to_dict()for logging
Files Changed
| File | Changes |
|---|---|
meteor_core/schema.py |
Added ImageLike, schema versions, to_dict() |
meteor_core/utils.py |
Added ensure_numpy() function |
PLUGIN_AUTHOR_GUIDE.md |
Updated DetectionContext/DetectionResult documentation |
CHANGELOG.md |
Added v1.6.1 entry |
README.md |
Updated "What's New" section |
Backward Compatibility
✅ Fully backward compatible with v1.6.0:
- CLI: No changes
- Runtime: No changes to detection behavior
- API: All existing detector plugins work unchanged
- Configuration: No changes