Callbacks
Writers
eva.core.callbacks.writers.EmbeddingsWriter
Bases: BasePredictionWriter
Callback for writing generated embeddings to disk.
This callback writes the embedding files in a separate process to avoid blocking the main process where the model forward pass is executed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_dir |
str
|
The directory where the embeddings will be saved. |
required |
backbone |
Module | None
|
A model to be used as feature extractor. If |
None
|
dataloader_idx_map |
Dict[int, str] | None
|
A dictionary mapping dataloader indices to their respective names (e.g. train, val, test). |
None
|
group_key |
str | None
|
The metadata key to group the embeddings by. If specified, the embedding files will be saved in subdirectories named after the group_key. If specified, the key must be present in the metadata of the input batch. |
None
|
overwrite |
bool
|
Whether to overwrite the output directory. Defaults to True. |
True
|