torchdrivesim.rendering.pytorch3d
#
PyTorch3D-based renderers, used by default in TorchDriveSim.
Module Contents#
Classes#
Blending choices from pytorch3d. May be ignored by other renderer types. |
|
Configuration of pytorch3d-based renderer. |
|
Shader that ignores lighting, based on https://github.com/facebookresearch/pytorch3d/issues/84 |
|
Renderer based on pytorch3d, using an orthographic projection and a trivial shader. |
- class torchdrivesim.rendering.pytorch3d.RenderingBlend[source]#
Bases:
enum.Enum
Blending choices from pytorch3d. May be ignored by other renderer types. https://pytorch3d.readthedocs.io/en/latest/modules/renderer/blending.html
- class torchdrivesim.rendering.pytorch3d.Pytorch3DRendererConfig[source]#
Bases:
torchdrivesim.rendering.base.RendererConfig
Configuration of pytorch3d-based renderer.
- differentiable_rendering: RenderingBlend[source]#
- class torchdrivesim.rendering.pytorch3d.Shader2D(device='cpu', background_color: Tuple[float, float, float] = (0, 0, 0), blend=RenderingBlend.soft)[source]#
Bases:
torch.nn.Module
Shader that ignores lighting, based on https://github.com/facebookresearch/pytorch3d/issues/84
- class torchdrivesim.rendering.pytorch3d.Pytorch3DRenderer(cfg: Pytorch3DRendererConfig, *args, **kwargs)[source]#
Bases:
torchdrivesim.rendering.base.BirdviewRenderer
Renderer based on pytorch3d, using an orthographic projection and a trivial shader. Works on both GPU and CPU, but CPU is very slow.
- render_mesh(mesh: torchdrivesim.mesh.BirdviewMesh, res: torchdrivesim.utils.Resolution, cameras: pytorch3d.renderer.FoVOrthographicCameras) torch.Tensor [source]#
Renders a given mesh, producing BxHxWxC tensor image of float RGB values in [0,255] range.