From b39ead2ef0fc9ca88cf50ab6f2b8f292f1a0c72a Mon Sep 17 00:00:00 2001 From: LinasKo Date: Wed, 6 Nov 2024 14:21:52 +0200 Subject: [PATCH] Revert "VideoSink automatically infers video_info" --- supervision/utils/video.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/supervision/utils/video.py b/supervision/utils/video.py index 9d67dbfb1..2e502cf2b 100644 --- a/supervision/utils/video.py +++ b/supervision/utils/video.py @@ -65,9 +65,8 @@ class VideoSink: Attributes: target_path (str): The path to the output file where the video will be saved. - video_info (Optional[VideoInfo]): Information about the output video resolution, - fps, and total frame count. If not provided, the information will be inferred - from the video path. + video_info (VideoInfo): Information about the video resolution, fps, + and total frame count. codec (str): FOURCC code for video format Example: @@ -83,16 +82,8 @@ class VideoSink: ``` """ # noqa: E501 // docs - def __init__( - self, - target_path: str, - video_info: Optional[VideoInfo] = None, - codec: str = "mp4v", - ): + def __init__(self, target_path: str, video_info: VideoInfo, codec: str = "mp4v"): self.target_path = target_path - - if video_info is None: - video_info = VideoInfo.from_video_path(target_path) self.video_info = video_info self.__codec = codec self.__writer = None