out_writer: fixed case filename=None
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user