viep-fault-detection / services /video_service.py
Sanjayraju30's picture
Update services/video_service.py
2088a52 verified
raw
history blame
217 Bytes
import cv2
def get_video_frame(video_path):
cap = cv2.VideoCapture(video_path)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
yield frame
cap.release()