Created
September 8, 2020 23:51
-
-
Save igorrendulic/dc9730fe64d42ab8729dc01f6298a47d to your computer and use it in GitHub Desktop.
This file contains 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') | |
host = validate_param('chrys_host') | |
password = validate_param('chrys_password') | |
cert_path = validate_param('chrys_cert') | |
chrys = chrysalis.Connect(host=host, port=port, password=password, ssl_ca_cert=cert_path) | |
while True: | |
img = chrys.VideoLatestImage() | |
if img is not None: | |
frame = img.data | |
frame = add_face_markers(frame) | |
cv2.imshow("facemarkers", frame) | |
if cv2.waitKey(1) & 0xFF == ord('q'): | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment