v0.9.5¶
Upgrade Notes¶
Binary files for the docs are now added through a pull request against the
assetsbranch instead of a force-push. Contributors who used the old recipe follow the updated “Adding binary files to the docs” section ofCONTRIBUTING.md.The file format of a serializable class is now declared on the class itself under one set of names, and the module-level constants that held it are gone.
_FILE_SUFFIXbecame__file_format__,_METADATA_KEYbecame__metadata_key__,_CLASS_KEYbecame__class_key__,_STATE_KEYSbecame__state_keys__, and every per-module format version (_CLUSTERING_EMBEDDER_FILE_FORMAT_VERSION,_NEURAL_EMBEDDER_FORMAT_VERSION,_PIPELINE_FORMAT_VERSION,_CLIP_EMBEDDER_FORMAT_VERSION,_STORE_FORMAT_VERSION) became__format_version__on the class that writes it. Their compatibility table is__compatibility_mapping__. Subclasses outside the library that set any of the old names have to rename them: the old names are no longer read, andSerializerMixinnow raises aTypeErrorat class-definition time when a class that implementsto_dictandfrom_dictleaves one of the required attributes undeclared.pyvisim.serialization.EMBEDDER_METADATA_KEYandpyvisim._base_classes.EMBEDDER_FILE_SUFFIXwere removed. Read them from the embedder class instead, for exampleVLADEmbedder.__metadata_key__andVLADEmbedder.__file_format__.Subclasses outside the library that implement
_embednow receive one batch as a list of canonicaluint8(H, W[, C])images, withoutdimsandvalue_range, sinceImageEmbedderBase.embednormalizes and batches the input. Drop the two parameters and the batching loop from your_embed.SerializerMixin.to_dictis no longer abstract. It adds the format version and the class name to the mapping returned by the new abstract_statemethod. Subclasses outside the library rename theirto_dictto_stateand drop theformat_versionand class-name entries from it, and__state_keys__no longer lists the class key. Loading a file whose state lacks the format version or the class name raises aValueError.pyvisim.serialization.embedder_to_dictandpyvisim.serialization.embedder_from_dictare removed. Code importing them callsembedder.to_dict()instead, andSerializableImageEmbedder.from_dict(state)to rebuild an embedder of any class from its state.
New Features¶
The
KMeans,DiagCovarGaussianMixtureandPCAmodels of the classic embedders can be saved on their own withsave_to_diskand loaded back withload_from_disk, as.safetensorsfiles.
Enhancement Notes¶
The
Benchmarksworkflow pushes its barplots todocs/benchmark-barplotsfor review instead of publishing them directly. The newSquash assetsworkflow keepsassetsat a single commit after each merge.Every embedder rejects an empty input with the same
ValueError(“Expected at least one image, got none.”) instead of a NumPy concatenation error or an embedder-specific message.Every
load_from_diskreports an unreadable file the same way, as “File … is not a valid <suffix> file” followed by the reason. The image store used to raise the bare reason, while the embedders dropped it.The clustering models of
VLADEmbedderandFisherVectorEmbedderrecord aformat_versionin their part of the.embedderfile. Files written before still load.