From f3c4337fc21567a19b895fec5e8bb6437dc7491e Mon Sep 17 00:00:00 2001 From: Matt Mazur Date: Wed, 15 Nov 2023 13:54:16 -0500 Subject: [PATCH] Create frames directory if it doesn't exist --- capture.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/capture.py b/capture.py index c94dfa3..bc9845c 100644 --- a/capture.py +++ b/capture.py @@ -2,10 +2,15 @@ import cv2 import time from PIL import Image import numpy as np +import os # Folder folder = "frames" +# Create the frames folder if it doesn't exist +frames_dir = os.path.join(os.getcwd(), folder) +os.makedirs(frames_dir, exist_ok=True) + # Initialize the webcam cap = cv2.VideoCapture(0)