torchdrivesim.rendering.nvdiffrast ================================== .. py:module:: torchdrivesim.rendering.nvdiffrast .. autoapi-nested-parse:: Nvdiffrast-based renderers, equivalent to those based on PyTorch3D but sometimes faster. This module imports correctly if nvdiffrast is missing, but the renderer will raise the NvdiffrastNotFound exception. Attributes ---------- .. autoapisummary:: torchdrivesim.rendering.nvdiffrast.is_available torchdrivesim.rendering.nvdiffrast.logger torchdrivesim.rendering.nvdiffrast.glctx_sessions Exceptions ---------- .. autoapisummary:: torchdrivesim.rendering.nvdiffrast.NvdiffrastNotFound Classes ------- .. autoapisummary:: torchdrivesim.rendering.nvdiffrast.NvdiffrastRendererConfig torchdrivesim.rendering.nvdiffrast.NvdiffrastRenderer Functions --------- .. autoapisummary:: torchdrivesim.rendering.nvdiffrast.get_glctx_session Module Contents --------------- .. py:data:: is_available :value: True .. py:data:: logger .. py:data:: glctx_sessions .. py:exception:: NvdiffrastNotFound Bases: :py:obj:`ImportError` Nvdiffrast is not installed. .. py:function:: get_glctx_session(device, opengl=True) .. py:class:: NvdiffrastRendererConfig Bases: :py:obj:`torchdrivesim.rendering.base.RendererConfig` Configuration of nvdiffrast-based renderer. .. py:attribute:: backend :type: str :value: 'nvdiffrast' .. py:attribute:: antialias :type: bool :value: False .. py:attribute:: opengl :type: bool :value: False .. py:attribute:: max_minibatch_size :type: Optional[int] :value: None .. py:class:: NvdiffrastRenderer(cfg: NvdiffrastRendererConfig, *args, **kwargs) Bases: :py:obj:`torchdrivesim.rendering.base.BirdviewRenderer` Similar to PyTorch3DRenderer, and producing indistinguishable images, but sometimes faster. Note that nvdiffrast requires separate installation and is subject to its own license terms. .. py:method:: render_mesh(mesh: torchdrivesim.mesh.BirdviewMesh, res: torchdrivesim.utils.Resolution, cameras: torchdrivesim.rendering.base.Cameras) -> torch.Tensor Renders a given mesh, producing BxHxWxC tensor image of float RGB values in [0,255] range.