out_writer: fixed case filename=None

This commit is contained in:
2025-12-01 18:51:29 +01:00
parent a572bb5cd1
commit 5d2fd557d1
+1 -1
View File
@@ -166,7 +166,7 @@ class Detector(abc.ABC):
cv.destroyAllWindows()
def out_writer(writer: cv.VideoWriter|None, frame: np.ndarray|None, filename: str = None) -> cv.VideoWriter:
if writer is None:
if writer is None and filename is not None:
fourcc = cv.VideoWriter.fourcc(*"mp4v")
frame_size = (frame.shape[1], frame.shape[0])
writer = cv.VideoWriter(filename=f"{RESULTS_FOLDER}/{filename}", fourcc=fourcc, fps=30.0, frameSize=frame_size)