@@ -90,7 +90,7 @@ def _iter_image_folder_frames(
9090class _VideoOutput :
9191 """Context manager for lazy video file writing."""
9292
93- def __init__ (self , path : Path | None , * , fps : float = _DEFAULT_OUTPUT_FPS ):
93+ def __init__ (self , path : Path | None , * , fps : float = _DEFAULT_OUTPUT_FPS ) -> None :
9494 self .path = path
9595 self .fps = fps
9696 self ._writer : cv2 .VideoWriter | None = None
@@ -137,7 +137,7 @@ def __exit__(self, *_: object) -> None:
137137class _DisplayWindow :
138138 """Context manager for OpenCV display window with resizable output."""
139139
140- def __init__ (self , window_name : str = "Tracking" ):
140+ def __init__ (self , window_name : str = "Tracking" ) -> None :
141141 self .window_name = window_name
142142 self ._quit_requested = False
143143 cv2 .namedWindow (self .window_name , cv2 .WINDOW_NORMAL | cv2 .WINDOW_KEEPRATIO )
@@ -159,8 +159,8 @@ def quit_requested(self) -> bool:
159159 """Return True if user pressed quit key."""
160160 return self ._quit_requested
161161
162- def __enter__ (self ):
162+ def __enter__ (self ) -> _DisplayWindow :
163163 return self
164164
165- def __exit__ (self , * _ ) :
165+ def __exit__ (self , * _ : object ) -> None :
166166 cv2 .destroyWindow (self .window_name )
0 commit comments