- added implementation to create 50sec video files out of camera lifestream for every 5 seconds
- added action unit recognition to the camera stream
This commit is contained in:
@@ -3,11 +3,11 @@ from feat.utils.io import get_test_data_path
|
||||
from moviepy.video.io.VideoFileClip import VideoFileClip
|
||||
import os
|
||||
|
||||
def extract_aus(path, model):
|
||||
def extract_aus(path, model, skip_frames):
|
||||
detector = Detector(au_model=model)
|
||||
|
||||
video_prediction = detector.detect(
|
||||
path, data_type="video", skip_frames=24*5, face_detection_threshold=0.95 # alle 5 Sekunden einbeziehen - 24 Frames pro Sekunde
|
||||
path, data_type="video", skip_frames=skip_frames, face_detection_threshold=0.95 # alle 5 Sekunden einbeziehen - 24 Frames pro Sekunde
|
||||
)
|
||||
|
||||
return video_prediction.aus.sum()
|
||||
@@ -38,13 +38,13 @@ def split_video(path, chunk_length=120):
|
||||
|
||||
return output_path
|
||||
|
||||
def start(path):
|
||||
results = []
|
||||
clips = split_video(path)
|
||||
# def start(path):
|
||||
# results = []
|
||||
# clips = split_video(path)
|
||||
|
||||
for clip in clips:
|
||||
results.append(extract_aus(clip, 'svm'))
|
||||
return results
|
||||
# for clip in clips:
|
||||
# results.append(extract_aus(clip, 'svm', 25*5))
|
||||
# return results
|
||||
|
||||
if __name__ == "__main__":
|
||||
results = []
|
||||
@@ -53,6 +53,6 @@ if __name__ == "__main__":
|
||||
clips = split_video(test_video_path)
|
||||
|
||||
for clippath in clips:
|
||||
results.append(extract_aus(clippath, 'svm'))
|
||||
results.append(extract_aus(clippath, 'svm', 25*5))
|
||||
|
||||
print(results)
|
||||
Reference in New Issue
Block a user