pytorch3d.vis.texture_vis

texture_vis

pytorch3d.vis.texture_vis.texturesuv_image_matplotlib(texture: TexturesUV, *, texture_index: int = 0, radius: float = 1, color=(1.0, 0.0, 0.0), subsample: int | None = 10000, origin: str = 'upper') None[source]

Plot the texture image for one element of a TexturesUV with matplotlib together with verts_uvs positions circled. In particular a value in verts_uvs which is never referenced in faces_uvs will still be plotted. This is for debugging purposes, e.g. to align the map with the uv coordinates. In particular, matplotlib is used which is not an official dependency of PyTorch3D.

Parameters:
  • texture – a TexturesUV object with one mesh

  • texture_index – index in the batch to plot

  • radius – plotted circle radius in pixels

  • color – any matplotlib-understood color for the circles.

  • subsample – if not None, number of points to plot. Otherwise all points are plotted.

  • origin – “upper” or “lower” like matplotlib.imshow . upper (the default) matches texturesuv_image_PIL.

pytorch3d.vis.texture_vis.texturesuv_image_PIL(texture: TexturesUV, *, texture_index: int = 0, radius: float = 1, color: Any = 'red', subsample: int | None = 10000)[source]

Return a PIL image of the texture image of one element of the batch from a TexturesUV, together with the verts_uvs positions circled. In particular a value in verts_uvs which is never referenced in faces_uvs will still be plotted. This is for debugging purposes, e.g. to align the map with the uv coordinates. In particular, matplotlib is used which is not an official dependency of PyTorch3D.

Parameters:
  • texture – a TexturesUV object with one mesh

  • texture_index – index in the batch to plot

  • radius – plotted circle radius in pixels

  • color – any PIL-understood color for the circles.

  • subsample – if not None, number of points to plot. Otherwise all points are plotted.

Returns:

PIL Image object.