Skip to content

Instantly share code, notes, and snippets.

@Gabe-flomo

Gabe-flomo/grouping.py Secret

Created Sep 29, 2020
Embed
What would you like to do?
# holds the cluster id and the images { id: [images] }
groups = {}
for file, cluster in zip(filenames,kmeans.labels_):
if cluster not in groups.keys():
groups[cluster] = []
groups[cluster].append(file)
else:
groups[cluster].append(file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment