Added training loop and model

This commit is contained in:
2023-02-21 23:24:51 +00:00
parent 1e05c02a7e
commit 98f29f683e
6 changed files with 191 additions and 10 deletions

View File

@@ -45,7 +45,7 @@ class KeypointExtractor:
# check if cache file exists and return
if os.path.exists(self.cache_folder + "/" + video + ".npy"):
# create dataframe from cache
return pd.DataFrame(np.load(self.cache_folder + "/" + video + ".npy"), columns=self.columns)
return pd.DataFrame(np.load(self.cache_folder + "/" + video + ".npy", allow_pickle=True), columns=self.columns)
# open video
cap = cv2.VideoCapture(self.video_folder + video)
@@ -89,7 +89,6 @@ class KeypointExtractor:
:return: the keypoints and the frame with keypoints on if draw is set to True
:rtype: np.ndarray
"""
print("Extracting keypoints from frame")
# Convert the BGR image to RGB and process it with MediaPipe Pose.
results = self.holistic.process(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))