You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to create .pkl file(landmarks file) for my own video but I'm facing an error. Please help me with the procedure to create .pkl file in the same way as how it is created for the LRW dataset. PFB the details on how i tried to create.
First, I tried to create using the below code. And when it tried to use it for my own video, it is throwing the error "TypeError: unsupported operand type(s) for /: 'dict' and 'int'"
Code used to create .pkl(Using Google colab)
import cv2
import face_recognition
import pickle
cap = cv2.VideoCapture("myvideo.mp4")
landmarks_data = []
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# Convert BGR image to RGB (required for face_recognition)
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Find all face landmarks in the frame
face_landmarks_list = face_recognition.face_landmarks(rgb_frame)
# Append the detected landmarks to the list
landmarks_data.append(face_landmarks_list)
cap.release()
# Serialize and save the landmarks data to a .pkl file
with open("myvideo.pkl", "wb") as file:
pickle.dump(landmarks_data, file)
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to create .pkl file(landmarks file) for my own video but I'm facing an error. Please help me with the procedure to create .pkl file in the same way as how it is created for the LRW dataset. PFB the details on how i tried to create.
First, I tried to create using the below code. And when it tried to use it for my own video, it is throwing the error "TypeError: unsupported operand type(s) for /: 'dict' and 'int'"
Code used to create .pkl(Using Google colab)
The text was updated successfully, but these errors were encountered: