import cv2
# This is a demo of running face recognition on a video file and saving the results to a new video file.
#
# PLEASE NOTE: This example requires OpenCV (the `cv2` library) to be installed only to read from your webcam.
# OpenCV is *not* required to use the face_recognition library. It's only required if you want to run this
# specific demo. If you have trouble installing it, try any of the other demos that don't require it instead.
# Open the input movie file
input_movie = cv2.VideoCapture("D:/work_test/object_predict.avi")
length = int(input_movie.get(cv2.CAP_PROP_FRAME_COUNT))
pre_file = '12_28_62_'
f_index = 0
while True:
# Grab a single frame of video
ret, frame = input_movie.read()
# Quit when the input video file ends
if not ret:
break
frame_resize = cv2.resize(frame,