Spaces:
Running
Running
Upload pickleface.py
Browse files- pickleface.py +19 -0
pickleface.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from avatar import Avatar
|
2 |
+
import pickle
|
3 |
+
|
4 |
+
# Khởi tạo Avatar
|
5 |
+
avatar = Avatar()
|
6 |
+
|
7 |
+
# Load video MC6
|
8 |
+
video_path = "ref_videos/MC6.mp4"
|
9 |
+
avatar.get_video_full_frames(video_path)
|
10 |
+
|
11 |
+
# Tạo face detection results
|
12 |
+
face_det_results = avatar.create_face_detection_results(avatar.video_full_frames, save_result=False)
|
13 |
+
|
14 |
+
# Lưu kết quả vào file pkl
|
15 |
+
output_path = "ref_videos/MC6_face_det_result.pkl"
|
16 |
+
with open(output_path, 'wb') as f:
|
17 |
+
pickle.dump(face_det_results, f)
|
18 |
+
|
19 |
+
print(f"Đã lưu face detection results vào {output_path}")
|