mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
ensure output path
This commit is contained in:
parent
aa47e33cf4
commit
5af32fa841
@ -91,7 +91,9 @@ def analysis(
|
||||
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
||||
fps = cap.get(cv2.CAP_PROP_FPS)
|
||||
fourcc = cv2.VideoWriter_fourcc(*"mp4v") # Codec for output file
|
||||
|
||||
# Ensure the output directory exists if output_path is provided
|
||||
if output_path:
|
||||
os.makedirs(os.path.dirname(output_path), exist_ok=True)
|
||||
# Initialize video writer if output_path is provided
|
||||
video_writer = (
|
||||
cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), fps, (width, height))
|
||||
|
Loading…
x
Reference in New Issue
Block a user