This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import cv2 | |
import dlib | |
from imutils import face_utils | |
import chrysalis | |
# get the display | |
os.environ['DISPLAY'] = ":0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_face_markers(frame): | |
""" | |
Adding face markers onto a single frame | |
""" | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
rects = detector(gray, 0) | |
for (i, rect) in enumerate(rects): | |
shape = predictor(gray, rect) | |
shape = face_utils.shape_to_np(shape) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate_param(param_name): | |
""" | |
Validating OS environment variables | |
""" | |
if param_name not in os.environ: | |
raise ValueError("missing environment variable " + param_name) | |
return os.environ[param_name] | |
if __name__ == "__main__": | |
port = validate_param('chrys_port') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input | |
from tensorflow.keras.preprocessing.image import img_to_array | |
from tensorflow.keras.models import load_model | |
import numpy as np | |
import imutils | |
import cv2 | |
import os | |
import time | |
import chrysalis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate_param(param_name): | |
""" | |
Validating OS environment variables | |
""" | |
if param_name not in os.environ: | |
raise ValueError("missing environment variable " + param_name) | |
return os.environ[param_name] | |
if __name__ == "__main__": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.mp4; do echo file $f >> list.txt; done | |
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4 |
OlderNewer