--- title: Export - keywords: fastai sidebar: home_sidebar nb_path: "nbs/indexers.FaceClusteringIndexer.Utils.ipynb" ---
confidence2clusters
confidence2clusters(confidences, dists, nbrs, tau)
confidences
dists
nbrs
tau
group_clusters
group_clusters(photos, cluster_labels, min_cluster_size=2)
photos
cluster_labels
min_cluster_size
2
sparse_mx_to_indices_values
sparse_mx_to_indices_values(sparse_mx)
sparse_mx
sparse_mx_to_torch_sparse_tensor
sparse_mx_to_torch_sparse_tensor(sparse_mx)
Convert a scipy sparse matrix to a torch sparse tensor.
indices_values_to_sparse_tensor
indices_values_to_sparse_tensor(indices, values, shape)
indices
values
shape
build_symmetric_adj
build_symmetric_adj(adj, self_loop=True)
adj
self_loop
True
row_normalize
row_normalize(mx)
mx
Row-normalize sparse matrix
peaks_to_edges
peaks_to_edges(peaks, dist2peak, tau)
peaks
dist2peak
confidence_to_peaks
confidence_to_peaks(dists, nbrs, confidence, max_conn=1)
confidence
max_conn
1
peaks_to_labels
peaks_to_labels(peaks, dist2peak, tau, inst_num)
inst_num
build_knns
build_knns(knn_prefix, feats, knn_method, k, num_process=None, is_rebuild=False, feat_create_time=None)
knn_prefix
feats
knn_method
k
num_process
None
is_rebuild
False
feat_create_time
edge_to_connected_graph
edge_to_connected_graph(edges, num)
edges
num
knns2ordered_nbrs
knns2ordered_nbrs(knns, sort=True)
knns
sort
read_meta
read_meta(fn_meta, start_pos=0, verbose=True)
fn_meta
start_pos
0
verbose
read_probs
read_probs(path, inst_num, feat_dim, dtype=float32, verbose=False)
path
feat_dim
dtype
float32
fast_knns2spmat
fast_knns2spmat(knns, k, th_sim=0.7, use_sim=False, fill_value=None)
th_sim
0.7
use_sim
fill_value
l2norm
l2norm(vec)
vec
class
knn_faiss
knn_faiss(feats, k, index_key='', nprobe=128, omp_num_threads=None, rebuild_index=True, verbose=True, **kwargs)
index_key
''
nprobe
128
omp_num_threads
rebuild_index
kwargs