aac_metrics.classes.clap_sim module¶
- class CLAPSim(
- return_all_scores: bool = True,
- *,
- clap_method: Literal['audio', 'text'] = 'text',
- clap_model: str | CLAPWrapper = 'MS-CLAP-2023',
- device: str | device | None = 'cuda_if_available',
- batch_size: int | None = 32,
- reset_state: bool = True,
- seed: int | None = 42,
- verbose: int = 0,
Bases:
AACMetric[tuple[CLAPScores,CLAPScores] |Tensor]Cosine-similarity of the Contrastive Language-Audio Pretraining (CLAP) embeddings.
The implementation is based on the msclap pypi package. Note: Instances of this class are not pickable.
msclap package: https://pypi.org/project/msclap/
For more information, see
clap_sim().- compute() tuple[CLAPScores, CLAPScores] | Tensor[source]¶