From 099fc069fb1113ea8d8dd4063a4cec7dce894118 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005307016 Date: Thu, 20 Jul 2023 12:37:46 -0700 Subject: [PATCH] suppress errors in `vision/fair/pytorch3d` Differential Revision: D47643182 fbshipit-source-id: 598de1526e0c717f2f7038c3f4873ac119c65bba --- pytorch3d/io/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pytorch3d/io/utils.py b/pytorch3d/io/utils.py index 76772405..ee437b3a 100644 --- a/pytorch3d/io/utils.py +++ b/pytorch3d/io/utils.py @@ -22,6 +22,7 @@ PathOrStr = Union[pathlib.Path, str] def _open_file(f, path_manager: PathManager, mode: str = "r") -> ContextManager[IO]: if isinstance(f, str): + # pyre-fixme[6]: For 2nd argument expected `Union[typing_extensions.Literal['... f = path_manager.open(f, mode) return contextlib.closing(f) elif isinstance(f, pathlib.Path): @@ -71,8 +72,6 @@ def _read_image(file_name: str, path_manager: PathManager, format=None): if format not in ["RGB", "BGR"]: raise ValueError("format can only be one of [RGB, BGR]; got %s", format) with path_manager.open(file_name, "rb") as f: - # pyre-fixme[6]: Expected `Union[str, typing.BinaryIO]` for 1st param but - # got `Union[typing.IO[bytes], typing.IO[str]]`. image = Image.open(f) if format is not None: # PIL only supports RGB. First convert to RGB and flip channels