Spaces:
Running
Running
Update avatar.py
Browse files
avatar.py
CHANGED
@@ -188,7 +188,7 @@ class Avatar:
|
|
188 |
# Kiểm tra và thiết lập device
|
189 |
if not hasattr(self, 'device') or self.device is None:
|
190 |
self.device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
191 |
-
|
192 |
# Khởi tạo detector với cấu hình đơn giản hơn
|
193 |
detector = FaceAlignment(
|
194 |
LandmarksType.TWO_D,
|
@@ -196,9 +196,10 @@ class Avatar:
|
|
196 |
face_detector='sfd' # Sử dụng SFD thay vì mặc định
|
197 |
)
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
202 |
predictions = []
|
203 |
while True:
|
204 |
try:
|
|
|
188 |
# Kiểm tra và thiết lập device
|
189 |
if not hasattr(self, 'device') or self.device is None:
|
190 |
self.device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
191 |
+
|
192 |
# Khởi tạo detector với cấu hình đơn giản hơn
|
193 |
detector = FaceAlignment(
|
194 |
LandmarksType.TWO_D,
|
|
|
196 |
face_detector='sfd' # Sử dụng SFD thay vì mặc định
|
197 |
)
|
198 |
|
199 |
+
# Chuyển đổi full_frames thành list
|
200 |
+
images = [frame for frame in full_frames]
|
201 |
+
|
202 |
+
# Xử lý batch
|
203 |
predictions = []
|
204 |
while True:
|
205 |
try:
|