lib.sedna.algorithms.reid.multi_img_matching

Module Contents

Functions

cosine_similarity_score([query, candidates])

Computes the cosine similarity score between the

tensor_reshape(→ torch.Tensor)

match_query_to_targets(→ Tuple[int, float])

Query features refer to the features of

lib.sedna.algorithms.reid.multi_img_matching.cosine_similarity_score(query: numpy.ndarray = None, candidates: numpy.ndarray = None)[source]
Computes the cosine similarity score between the

query feature and the candidate features.

@param query: Feature map of dimension

[1, n_feat_dim] representing the query.

@param candidates: Feature map of dimension

[n_candidates, n_feat_dim] representing the candidate for match.

lib.sedna.algorithms.reid.multi_img_matching.tensor_reshape(data: Any) torch.Tensor[source]
lib.sedna.algorithms.reid.multi_img_matching.match_query_to_targets(query_feats: List, candidate_feats: List, avg_mode: bool = False) Tuple[int, float][source]

Query features refer to the features of the person we are looking for in the video. Candidate features refers to features of the persons found by the detector in the current scene. :param query_feats: [M x d] M being the number of target images in the query :param candidate_feats: [N x d] N is the number of persons detected in the scene :param avg_mode: If set, use an average representation of the query.

Query feats becomes [1 x d]

Returns:

Id of the candidate which best matches the query