@@ -162,8 +162,13 @@ Accessing camera data
162162
163163.. code-block :: python
164164
165+ import warp as wp
166+
165167 tiled_camera = Camera(cfg.tiled_camera)
166- data = tiled_camera.data.output[" rgb" ] # shape: (num_cameras, H, W, 3), torch.uint8
168+ # ``data.output`` entries are ``wp.array`` values (e.g. ``wp.uint8``); use
169+ # :func:`warp.to_torch` when Torch tensor operations are required.
170+ data_wp = tiled_camera.data.output[" rgb" ] # shape: (num_cameras, H, W, 3), wp.uint8
171+ data = wp.to_torch(data_wp) # zero-copy torch.uint8 view
167172
168173 The returned data has shape ``(num_cameras, height, width, num_channels) ``, ready to use directly
169174as an observation in RL training.
@@ -207,11 +212,12 @@ RGB and RGBA
207212 :figwidth: 100%
208213 :alt: A scene captured in RGB
209214
210- ``rgb `` returns a 3-channel RGB image of type ``torch .uint8 ``, shape ``(B, H, W, 3) ``.
215+ ``rgb `` returns a 3-channel RGB image of type ``wp .uint8 ``, shape ``(B, H, W, 3) ``.
211216
212- ``rgba `` returns a 4-channel RGBA image of type ``torch .uint8 ``, shape ``(B, H, W, 4) ``.
217+ ``rgba `` returns a 4-channel RGBA image of type ``wp .uint8 ``, shape ``(B, H, W, 4) ``.
213218
214- To convert to ``torch.float32 ``, divide by 255.0.
219+ Use :func: `warp.to_torch ` to obtain a zero-copy ``torch.uint8 `` view; divide by ``255.0 ``
220+ to convert to ``torch.float32 ``.
215221
216222Depth and Distances
217223~~~~~~~~~~~~~~~~~~~
@@ -222,10 +228,10 @@ Depth and Distances
222228 :alt: A scene captured as depth
223229
224230``distance_to_camera `` returns a single-channel depth image with distance to the camera optical
225- center, shape ``(B, H, W, 1) ``, type ``torch .float32 ``.
231+ center, shape ``(B, H, W, 1) ``, type ``wp .float32 ``.
226232
227233``distance_to_image_plane `` returns distances of 3D points from the camera plane along the Z-axis,
228- shape ``(B, H, W, 1) ``, type ``torch .float32 ``.
234+ shape ``(B, H, W, 1) ``, type ``wp .float32 ``.
229235
230236``depth `` is an alias for ``distance_to_image_plane ``.
231237
@@ -238,14 +244,14 @@ Normals
238244 :alt: A scene captured with surface normals
239245
240246``normals `` returns local surface normal vectors at each pixel, shape ``(B, H, W, 3) `` containing
241- ``(x, y, z) ``, type ``torch .float32 ``.
247+ ``(x, y, z) ``, type ``wp .float32 ``.
242248
243249Motion Vectors
244250~~~~~~~~~~~~~~
245251
246252``motion_vectors `` returns per-pixel motion vectors in image space between frames.
247253Shape ``(B, H, W, 2) ``: ``x `` is horizontal motion (positive = left), ``y `` is vertical motion
248- (positive = up). Type ``torch .float32 ``.
254+ (positive = up). Type ``wp .float32 ``.
249255
250256Semantic Segmentation
251257~~~~~~~~~~~~~~~~~~~~~
@@ -259,8 +265,8 @@ Semantic Segmentation
259265An ``info `` dictionary is available via ``tiled_camera.data.info['semantic_segmentation'] ``.
260266
261267- If ``colorize_semantic_segmentation=True ``: 4-channel RGBA image, shape ``(B, H, W, 4) ``,
262- type ``torch .uint8 ``. The ``idToLabels `` dict maps color to semantic label.
263- - If ``colorize_semantic_segmentation=False ``: shape ``(B, H, W, 1) ``, type ``torch .int32 ``,
268+ type ``wp .uint8 ``. The ``idToLabels `` dict maps color to semantic label.
269+ - If ``colorize_semantic_segmentation=False ``: shape ``(B, H, W, 1) ``, type ``wp .int32 ``,
264270 containing semantic IDs. The ``idToLabels `` dict maps ID to label.
265271
266272Instance ID Segmentation
@@ -274,9 +280,9 @@ Instance ID Segmentation
274280``instance_id_segmentation_fast `` outputs per-pixel instance IDs, unique per USD prim path.
275281An ``info `` dictionary is available via ``tiled_camera.data.info['instance_id_segmentation_fast'] ``.
276282
277- - If ``colorize_instance_id_segmentation=True ``: shape ``(B, H, W, 4) ``, type ``torch .uint8 ``.
283+ - If ``colorize_instance_id_segmentation=True ``: shape ``(B, H, W, 4) ``, type ``wp .uint8 ``.
278284 The ``idToLabels `` dict maps color to USD prim path.
279- - If ``colorize_instance_id_segmentation=False ``: shape ``(B, H, W, 1) ``, type ``torch .int32 ``.
285+ - If ``colorize_instance_id_segmentation=False ``: shape ``(B, H, W, 1) ``, type ``wp .int32 ``.
280286 The ``idToLabels `` dict maps instance ID to USD prim path.
281287
282288Instance Segmentation
@@ -292,8 +298,8 @@ to the lowest level with semantic labels (unlike ``instance_id_segmentation_fast
292298goes to the leaf prim).
293299An ``info `` dictionary is available via ``tiled_camera.data.info['instance_segmentation_fast'] ``.
294300
295- - If ``colorize_instance_segmentation=True ``: shape ``(B, H, W, 4) ``, type ``torch .uint8 ``.
296- - If ``colorize_instance_segmentation=False ``: shape ``(B, H, W, 1) ``, type ``torch .int32 ``.
301+ - If ``colorize_instance_segmentation=True ``: shape ``(B, H, W, 4) ``, type ``wp .uint8 ``.
302+ - If ``colorize_instance_segmentation=False ``: shape ``(B, H, W, 1) ``, type ``wp .int32 ``.
297303
298304The ``idToLabels `` dict maps color to USD prim path. The ``idToSemantics `` dict maps color to
299305semantic label.
0 commit comments