osc.models.embeds

Positional embeddings and query tokens for objects.

Functions

torch_kmeans_cosine

Batched k-means for PyTorch with cosine distance.

torch_kmeans_euclidean

Batched k-means for PyTorch with Euclidean distance.

Classes

KmeansCosineObjectTokens

Initializes internal Module state, shared by both nn.Module and ScriptModule.

KmeansEuclideanObjectTokens

Initializes internal Module state, shared by both nn.Module and ScriptModule.

LearnedObjectTokens

Fixed number of learnable object tokens, shape [S C]

PositionalEmbedding

Initializes internal Module state, shared by both nn.Module and ScriptModule.

SampledObjectTokens

Dynamically sample S object tokens from K gaussian components.