Unverified Commit 01537843 authored by Santiago Castro's avatar Santiago Castro Committed by GitHub
Browse files

Typing fixes for torchvision.io.video.read_video (#4141)

parent ef711591
...@@ -3,6 +3,7 @@ import math ...@@ -3,6 +3,7 @@ import math
import os import os
import re import re
import warnings import warnings
from fractions import Fraction
from typing import Any, Dict, List, Optional, Tuple, Union from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np import numpy as np
...@@ -236,7 +237,10 @@ def _align_audio_frames( ...@@ -236,7 +237,10 @@ def _align_audio_frames(
def read_video( def read_video(
filename: str, start_pts: int = 0, end_pts: Optional[float] = None, pts_unit: str = "pts" filename: str,
start_pts: Union[float, Fraction] = 0,
end_pts: Optional[Union[float, Fraction]] = None,
pts_unit: str = "pts",
) -> Tuple[torch.Tensor, torch.Tensor, Dict[str, Any]]: ) -> Tuple[torch.Tensor, torch.Tensor, Dict[str, Any]]:
""" """
Reads a video from a file, returning both the video frames as well as Reads a video from a file, returning both the video frames as well as
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment