Callbacks
Writers
eva.core.callbacks.writers.ClassificationEmbeddingsWriter
Bases: EmbeddingsWriter
Callback for writing generated embeddings to disk for classification tasks.
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
|
metadata_keys |
List[str] | None
|
An optional list of keys to extract from the batch metadata and store as additional columns in the manifest file. |
None
|
overwrite |
bool
|
Whether to overwrite if embeddings are already present in the specified
output directory. If set to |
False
|
save_every_n |
int
|
Interval for number of iterations to save the embeddings to disk. During this interval, the embeddings are accumulated in memory. |
100
|