diff --git a/pytorch3d/datasets/shapenet_base.py b/pytorch3d/datasets/shapenet_base.py index d90bea67..54e41b92 100644 --- a/pytorch3d/datasets/shapenet_base.py +++ b/pytorch3d/datasets/shapenet_base.py @@ -45,6 +45,7 @@ def __init__(self) -> None: self.model_dir = "model.obj" self.load_textures = True self.texture_resolution = 4 + self.texture_wrap = "clamp" def __len__(self) -> int: """ @@ -90,6 +91,7 @@ def _load_mesh(self, model_path) -> Tuple: create_texture_atlas=self.load_textures, load_textures=self.load_textures, texture_atlas_size=self.texture_resolution, + texture_wrap = self.texture_wrap ) if self.load_textures: textures = aux.texture_atlas diff --git a/pytorch3d/io/obj_io.py b/pytorch3d/io/obj_io.py index 3cc29794..49bf4387 100644 --- a/pytorch3d/io/obj_io.py +++ b/pytorch3d/io/obj_io.py @@ -148,9 +148,9 @@ def load_obj( map is created per face. texture_wrap: string, one of ["repeat", "clamp"]. This applies when computing the texture atlas. - If `texture_mode="repeat"`, for uv values outside the range [0, 1] the integer part + If `texture_wrap="repeat"`, for uv values outside the range [0, 1] the integer part is ignored and a repeating pattern is formed. - If `texture_mode="clamp"` the values are clamped to the range [0, 1]. + If `texture_wrap="clamp"` the values are clamped to the range [0, 1]. If None, then there is no transformation of the texture values. device: Device (as str or torch.device) on which to return the new tensors. path_manager: optionally a PathManager object to interpret paths.