common.py 495 Bytes
Newer Older
Kyle Anderson's avatar
Kyle Anderson committed
1 2 3 4 5 6
import time

import cv2
from imutils.video import VideoStream

USER_IDS_KEY = "user_ids"
Kyle Anderson's avatar
Kyle Anderson committed
7
DATABASE_LOC = "./dataset/faces.pickle"
Kyle Anderson's avatar
Kyle Anderson committed
8 9 10 11 12 13 14 15 16 17 18 19 20


def display_frame(frame):
    """Displays the frame to the user."""
    cv2.imshow("Frame", frame)


def start_video_stream(camera: int):
    """Starts the video stream and returns the created stream.
    Also waits for the video stream to open before returning it."""
    video_stream = VideoStream(src=camera).start()
    time.sleep(2.0)
    return video_stream