Spaces:
Runtime error
Runtime error
Update face_analysis.py
Browse files- face_analysis.py +2 -2
face_analysis.py
CHANGED
@@ -33,10 +33,10 @@ def cluster_faces(embeddings):
|
|
33 |
|
34 |
return clusters
|
35 |
|
36 |
-
def organize_faces_by_person(embeddings_by_frame, clusters,
|
37 |
for (frame_num, embedding), cluster in zip(embeddings_by_frame.items(), clusters):
|
38 |
person_folder = os.path.join(organized_faces_folder, f"person_{cluster}")
|
39 |
os.makedirs(person_folder, exist_ok=True)
|
40 |
-
src = os.path.join(
|
41 |
dst = os.path.join(person_folder, f"frame_{frame_num}_face.jpg")
|
42 |
shutil.copy(src, dst)
|
|
|
33 |
|
34 |
return clusters
|
35 |
|
36 |
+
def organize_faces_by_person(embeddings_by_frame, clusters, faces_folder, organized_faces_folder):
|
37 |
for (frame_num, embedding), cluster in zip(embeddings_by_frame.items(), clusters):
|
38 |
person_folder = os.path.join(organized_faces_folder, f"person_{cluster}")
|
39 |
os.makedirs(person_folder, exist_ok=True)
|
40 |
+
src = os.path.join(faces_folder, f"frame_{frame_num}_face.jpg")
|
41 |
dst = os.path.join(person_folder, f"frame_{frame_num}_face.jpg")
|
42 |
shutil.copy(src, dst)
|