Skip to content

Instantly share code, notes, and snippets.

@bookjan
bookjan / face-detection.py
Last active January 18, 2022 08:02
Using python opencv to detect face and send the frames to FFmpeg to create HLS(HTTP Live Streaming)
import numpy as np
import cv2
import sys
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier('<PATH_TO_CASCADES_FOLDER>/haarcascade_frontalface_default.xml')
while(True):
# Capture frame-by-frame