mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2024-11-10 00:34:29 +00:00
lint
This commit is contained in:
parent
2d39c46b89
commit
ce74a0482a
1 changed files with 4 additions and 3 deletions
|
@ -84,8 +84,9 @@ class VideoProxy:
|
||||||
Note that this order flips the order of height and width from typical resolution
|
Note that this order flips the order of height and width from typical resolution
|
||||||
specifications: eg. 1080p video is typically 1920x1080, but here it would be
|
specifications: eg. 1080p video is typically 1920x1080, but here it would be
|
||||||
1080x1920. This follows opencv's ordering, which matches expectations when
|
1080x1920. This follows opencv's ordering, which matches expectations when
|
||||||
eg. an image is read and plotted with matplotlib: the first index is the position
|
eg. an image is read and plotted with matplotlib: the first index is the
|
||||||
in the 0th dimension - the height, or "y" axis - and the second is the width/x.
|
position in the 0th dimension - the height, or "y" axis - and the second is the
|
||||||
|
width/x.
|
||||||
"""
|
"""
|
||||||
if self._shape is None:
|
if self._shape is None:
|
||||||
self._shape = (self.n_frames, *self.sample_frame.shape)
|
self._shape = (self.n_frames, *self.sample_frame.shape)
|
||||||
|
@ -117,7 +118,7 @@ class VideoProxy:
|
||||||
self._n_frames = int(n_frames)
|
self._n_frames = int(n_frames)
|
||||||
return self._n_frames
|
return self._n_frames
|
||||||
|
|
||||||
def _get_frame(self, frame: int):
|
def _get_frame(self, frame: int) -> np.ndarray:
|
||||||
self.video.set(cv2.CAP_PROP_POS_FRAMES, frame)
|
self.video.set(cv2.CAP_PROP_POS_FRAMES, frame)
|
||||||
status, frame = self.video.read()
|
status, frame = self.video.read()
|
||||||
if not status: # pragma: no cover
|
if not status: # pragma: no cover
|
||||||
|
|
Loading…
Reference in a new issue