def eval_process_image_dir_worker(con): embeddings_with_ids = list(DBManager.get_all_embeddings(with_ids=True)) eval_core_algorithm = EvalCoreAlgorithm(metric=metric, classification_threshold=threshold) # passing result cluster dict already overwrites it clustering_result = eval_core_algorithm.cluster_embeddings_no_split(embeddings_with_ids, existing_clusters_dict=cluster_dict, should_reset_cluster_ids=True, final_clusters_only=False) _, modified_clusters_dict, removed_clusters_dict = clustering_result DBManager.overwrite_clusters_simplified(modified_clusters_dict, removed_clusters_dict, con=con, close_connections=False)
def cluster_processed_faces(con): embeddings_with_ids = list( DBManager.get_all_embeddings(with_ids=True)) # TODO: Call reclassify handler here? # TODO: Clear existing clusters? Issues with ids etc.???? core_algorithm = CoreAlgorithm() # passing result cluster dict already overwrites it clustering_result = core_algorithm.cluster_embeddings( embeddings_with_ids, existing_clusters_dict=cluster_dict, should_reset_cluster_ids=True, final_clusters_only=False) _, modified_clusters_dict, removed_clusters_dict = clustering_result DBManager.overwrite_clusters_simplified(modified_clusters_dict, removed_clusters_dict, con=con, close_connections=False)