mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-04 04:42:49 +08:00
upgrade pyre version in fbcode/vision
- batch 2
Differential Revision: D42947615 fbshipit-source-id: 47b078fdf68567220e15993ab643f85771b0d340
This commit is contained in:
parent
18c38ad600
commit
d8471b26f2
@ -368,6 +368,8 @@ class R2N2(ShapeNetBase): # pragma: no cover
|
|||||||
T = RT[3, :3]
|
T = RT[3, :3]
|
||||||
return R, T
|
return R, T
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `render` overrides method defined in `ShapeNetBase`
|
||||||
|
# inconsistently.
|
||||||
def render(
|
def render(
|
||||||
self,
|
self,
|
||||||
model_ids: Optional[List[str]] = None,
|
model_ids: Optional[List[str]] = None,
|
||||||
|
@ -57,6 +57,7 @@ class ImplicitronEvaluator(EvaluatorBase):
|
|||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
run_auto_creation(self)
|
run_auto_creation(self)
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `run` overrides method defined in `EvaluatorBase` inconsistently.
|
||||||
def run(
|
def run(
|
||||||
self,
|
self,
|
||||||
model: ImplicitronModelBase,
|
model: ImplicitronModelBase,
|
||||||
|
@ -315,6 +315,8 @@ class GenericModel(ImplicitronModelBase): # pyre-ignore: 13
|
|||||||
|
|
||||||
self.log_loss_weights()
|
self.log_loss_weights()
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `forward` overrides method defined in `ImplicitronModelBase`
|
||||||
|
# inconsistently.
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
*, # force keyword-only arguments
|
*, # force keyword-only arguments
|
||||||
|
@ -345,6 +345,8 @@ class SRNImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
|
|||||||
def raymarch_function_tweak_args(cls, type, args: DictConfig) -> None:
|
def raymarch_function_tweak_args(cls, type, args: DictConfig) -> None:
|
||||||
args.pop("latent_dim", None)
|
args.pop("latent_dim", None)
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `forward` overrides method defined in `ImplicitFunctionBase`
|
||||||
|
# inconsistently.
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
@ -404,6 +406,8 @@ class SRNHyperNetImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
|
|||||||
args.pop("latent_dim", None)
|
args.pop("latent_dim", None)
|
||||||
args.pop("latent_dim_hypernet", None)
|
args.pop("latent_dim_hypernet", None)
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `forward` overrides method defined in `ImplicitFunctionBase`
|
||||||
|
# inconsistently.
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
|
@ -41,6 +41,8 @@ class ModelDBIR(ImplicitronModelBase):
|
|||||||
bg_color: Tuple[float, float, float] = (0.0, 0.0, 0.0)
|
bg_color: Tuple[float, float, float] = (0.0, 0.0, 0.0)
|
||||||
max_points: int = -1
|
max_points: int = -1
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `forward` overrides method defined in `ImplicitronModelBase`
|
||||||
|
# inconsistently.
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
*, # force keyword-only arguments
|
*, # force keyword-only arguments
|
||||||
|
@ -111,6 +111,8 @@ class AccumulativeRaymarcherBase(RaymarcherBase, torch.nn.Module):
|
|||||||
"minimum": lambda curr, acc: torch.minimum(curr, acc),
|
"minimum": lambda curr, acc: torch.minimum(curr, acc),
|
||||||
}[self.weight_function_type]
|
}[self.weight_function_type]
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `forward` overrides method defined in `RaymarcherBase`
|
||||||
|
# inconsistently.
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
rays_densities: torch.Tensor,
|
rays_densities: torch.Tensor,
|
||||||
|
@ -66,6 +66,8 @@ class SignedDistanceFunctionRenderer(BaseRenderer, torch.nn.Module): # pyre-ign
|
|||||||
def requires_object_mask(self) -> bool:
|
def requires_object_mask(self) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `forward` overrides method defined in `BaseRenderer`
|
||||||
|
# inconsistently.
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
ray_bundle: ImplicitronRayBundle,
|
ray_bundle: ImplicitronRayBundle,
|
||||||
|
@ -86,6 +86,8 @@ class VideoWriter:
|
|||||||
or a 2-tuple defining the size of the output image.
|
or a 2-tuple defining the size of the output image.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# pyre-fixme[6]: For 1st argument expected `Union[PathLike[str], str]` but
|
||||||
|
# got `Optional[str]`.
|
||||||
outfile = os.path.join(self.cache_dir, self.regexp % self.frame_num)
|
outfile = os.path.join(self.cache_dir, self.regexp % self.frame_num)
|
||||||
|
|
||||||
if isinstance(frame, matplotlib.figure.Figure):
|
if isinstance(frame, matplotlib.figure.Figure):
|
||||||
@ -130,6 +132,8 @@ class VideoWriter:
|
|||||||
if self.frame_num == 0:
|
if self.frame_num == 0:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
# pyre-fixme[6]: For 1st argument expected `Union[PathLike[str], str]` but
|
||||||
|
# got `Optional[str]`.
|
||||||
regexp = os.path.join(self.cache_dir, self.regexp)
|
regexp = os.path.join(self.cache_dir, self.regexp)
|
||||||
|
|
||||||
if shutil.which(self.ffmpeg_bin) is None:
|
if shutil.which(self.ffmpeg_bin) is None:
|
||||||
|
@ -215,6 +215,8 @@ def load_obj(
|
|||||||
"""
|
"""
|
||||||
data_dir = "./"
|
data_dir = "./"
|
||||||
if isinstance(f, (str, bytes, Path)):
|
if isinstance(f, (str, bytes, Path)):
|
||||||
|
# pyre-fixme[6]: For 1st argument expected `PathLike[Variable[AnyStr <:
|
||||||
|
# [str, bytes]]]` but got `Union[Path, bytes, str]`.
|
||||||
data_dir = os.path.dirname(f)
|
data_dir = os.path.dirname(f)
|
||||||
if path_manager is None:
|
if path_manager is None:
|
||||||
path_manager = PathManager()
|
path_manager = PathManager()
|
||||||
@ -296,6 +298,8 @@ class MeshObjFormat(MeshFormatInterpreter):
|
|||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.known_suffixes = (".obj",)
|
self.known_suffixes = (".obj",)
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `read` overrides method defined in `MeshFormatInterpreter`
|
||||||
|
# inconsistently.
|
||||||
def read(
|
def read(
|
||||||
self,
|
self,
|
||||||
path: PathOrStr,
|
path: PathOrStr,
|
||||||
@ -320,6 +324,8 @@ class MeshObjFormat(MeshFormatInterpreter):
|
|||||||
)
|
)
|
||||||
return mesh
|
return mesh
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `save` overrides method defined in `MeshFormatInterpreter`
|
||||||
|
# inconsistently.
|
||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
data: Meshes,
|
data: Meshes,
|
||||||
|
@ -456,6 +456,8 @@ class MeshOffFormat(MeshFormatInterpreter):
|
|||||||
)
|
)
|
||||||
return mesh
|
return mesh
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `save` overrides method defined in `MeshFormatInterpreter`
|
||||||
|
# inconsistently.
|
||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
data: Meshes,
|
data: Meshes,
|
||||||
|
@ -1372,6 +1372,8 @@ class MeshPlyFormat(MeshFormatInterpreter):
|
|||||||
)
|
)
|
||||||
return mesh
|
return mesh
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `save` overrides method defined in `MeshFormatInterpreter`
|
||||||
|
# inconsistently.
|
||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
data: Meshes,
|
data: Meshes,
|
||||||
@ -1452,6 +1454,8 @@ class PointcloudPlyFormat(PointcloudFormatInterpreter):
|
|||||||
)
|
)
|
||||||
return pointcloud
|
return pointcloud
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `save` overrides method defined in
|
||||||
|
# `PointcloudFormatInterpreter` inconsistently.
|
||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
data: Pointclouds,
|
data: Pointclouds,
|
||||||
|
@ -695,6 +695,8 @@ class FoVPerspectiveCameras(CamerasBase):
|
|||||||
)
|
)
|
||||||
return transform
|
return transform
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `unproject_points` overrides method defined in `CamerasBase`
|
||||||
|
# inconsistently.
|
||||||
def unproject_points(
|
def unproject_points(
|
||||||
self,
|
self,
|
||||||
xy_depth: torch.Tensor,
|
xy_depth: torch.Tensor,
|
||||||
@ -938,6 +940,8 @@ class FoVOrthographicCameras(CamerasBase):
|
|||||||
)
|
)
|
||||||
return transform
|
return transform
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `unproject_points` overrides method defined in `CamerasBase`
|
||||||
|
# inconsistently.
|
||||||
def unproject_points(
|
def unproject_points(
|
||||||
self,
|
self,
|
||||||
xy_depth: torch.Tensor,
|
xy_depth: torch.Tensor,
|
||||||
@ -1145,6 +1149,8 @@ class PerspectiveCameras(CamerasBase):
|
|||||||
)
|
)
|
||||||
return transform
|
return transform
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `unproject_points` overrides method defined in `CamerasBase`
|
||||||
|
# inconsistently.
|
||||||
def unproject_points(
|
def unproject_points(
|
||||||
self,
|
self,
|
||||||
xy_depth: torch.Tensor,
|
xy_depth: torch.Tensor,
|
||||||
@ -1382,6 +1388,8 @@ class OrthographicCameras(CamerasBase):
|
|||||||
)
|
)
|
||||||
return transform
|
return transform
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `unproject_points` overrides method defined in `CamerasBase`
|
||||||
|
# inconsistently.
|
||||||
def unproject_points(
|
def unproject_points(
|
||||||
self,
|
self,
|
||||||
xy_depth: torch.Tensor,
|
xy_depth: torch.Tensor,
|
||||||
|
@ -347,6 +347,8 @@ class FishEyeCameras(CamerasBase):
|
|||||||
point3d_est[..., :2] = theta.tan()[..., None] / xr_yrNorm[..., None] * xr_yr
|
point3d_est[..., :2] = theta.tan()[..., None] / xr_yrNorm[..., None] * xr_yr
|
||||||
return point3d_est
|
return point3d_est
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `unproject_points` overrides method defined in `CamerasBase`
|
||||||
|
# inconsistently.
|
||||||
def unproject_points(
|
def unproject_points(
|
||||||
self,
|
self,
|
||||||
xy_depth: torch.Tensor,
|
xy_depth: torch.Tensor,
|
||||||
|
@ -491,6 +491,8 @@ class TexturesAtlas(TexturesBase):
|
|||||||
new_tex._num_faces_per_mesh = new_props["_num_faces_per_mesh"]
|
new_tex._num_faces_per_mesh = new_props["_num_faces_per_mesh"]
|
||||||
return new_tex
|
return new_tex
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `sample_textures` overrides method defined in `TexturesBase`
|
||||||
|
# inconsistently.
|
||||||
def sample_textures(self, fragments, **kwargs) -> torch.Tensor:
|
def sample_textures(self, fragments, **kwargs) -> torch.Tensor:
|
||||||
"""
|
"""
|
||||||
This is similar to a nearest neighbor sampling and involves a
|
This is similar to a nearest neighbor sampling and involves a
|
||||||
@ -927,6 +929,8 @@ class TexturesUV(TexturesBase):
|
|||||||
new_tex._num_faces_per_mesh = new_props["_num_faces_per_mesh"]
|
new_tex._num_faces_per_mesh = new_props["_num_faces_per_mesh"]
|
||||||
return new_tex
|
return new_tex
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `sample_textures` overrides method defined in `TexturesBase`
|
||||||
|
# inconsistently.
|
||||||
def sample_textures(self, fragments, **kwargs) -> torch.Tensor:
|
def sample_textures(self, fragments, **kwargs) -> torch.Tensor:
|
||||||
"""
|
"""
|
||||||
Interpolate a 2D texture map using uv vertex texture coordinates for each
|
Interpolate a 2D texture map using uv vertex texture coordinates for each
|
||||||
@ -1450,6 +1454,8 @@ class TexturesVertex(TexturesBase):
|
|||||||
new_tex._num_verts_per_mesh = new_props["_num_verts_per_mesh"]
|
new_tex._num_verts_per_mesh = new_props["_num_verts_per_mesh"]
|
||||||
return new_tex
|
return new_tex
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `sample_textures` overrides method defined in `TexturesBase`
|
||||||
|
# inconsistently.
|
||||||
def sample_textures(self, fragments, faces_packed=None) -> torch.Tensor:
|
def sample_textures(self, fragments, faces_packed=None) -> torch.Tensor:
|
||||||
"""
|
"""
|
||||||
Determine the color for each rasterized face. Interpolate the colors for
|
Determine the color for each rasterized face. Interpolate the colors for
|
||||||
@ -1518,6 +1524,8 @@ class TexturesVertex(TexturesBase):
|
|||||||
|
|
||||||
return self.__class__(sub_features)
|
return self.__class__(sub_features)
|
||||||
|
|
||||||
|
# pyre-fixme[14]: `faces_verts_textures_packed` overrides method defined in
|
||||||
|
# `TexturesBase` inconsistently.
|
||||||
def faces_verts_textures_packed(self, faces_packed=None) -> torch.Tensor:
|
def faces_verts_textures_packed(self, faces_packed=None) -> torch.Tensor:
|
||||||
"""
|
"""
|
||||||
Samples texture from each vertex and for each face in the mesh.
|
Samples texture from each vertex and for each face in the mesh.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user