mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-24 16:20:34 +08:00
examples and docs.
Summary: This diff updates the documentation and tutorials with information about the new pulsar backend. For more information about the pulsar backend, see the release notes and the paper (https://arxiv.org/abs/2004.07484). For information on how to use the backend, see the point cloud rendering notebook and the examples in the folder docs/examples. Reviewed By: nikhilaravi Differential Revision: D24498129 fbshipit-source-id: e312b0169a72b13590df6e4db36bfe6190d742f9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
960fd6d8b6
commit
039e02601d
@@ -5,6 +5,7 @@ This example demonstrates the most trivial, direct interface of the pulsar
|
||||
sphere renderer. It renders and saves an image with 10 random spheres.
|
||||
Output: basic.png.
|
||||
"""
|
||||
import math
|
||||
from os import path
|
||||
|
||||
import imageio
|
||||
@@ -12,11 +13,15 @@ import torch
|
||||
from pytorch3d.renderer.points.pulsar import Renderer
|
||||
|
||||
|
||||
torch.manual_seed(1)
|
||||
|
||||
n_points = 10
|
||||
width = 1_000
|
||||
height = 1_000
|
||||
device = torch.device("cuda")
|
||||
renderer = Renderer(width, height, n_points).to(device)
|
||||
# The PyTorch3D system is right handed; in pulsar you can choose the handedness.
|
||||
# For easy reproducibility we use a right handed coordinate system here.
|
||||
renderer = Renderer(width, height, n_points, right_handed_system=True).to(device)
|
||||
# Generate sample data.
|
||||
vert_pos = torch.rand(n_points, 3, dtype=torch.float32, device=device) * 10.0
|
||||
vert_pos[:, 2] += 25.0
|
||||
@@ -29,7 +34,7 @@ cam_params = torch.tensor(
|
||||
0.0,
|
||||
0.0, # Position 0, 0, 0 (x, y, z).
|
||||
0.0,
|
||||
0.0,
|
||||
math.pi, # Because of the right handed system, the camera must look 'back'.
|
||||
0.0, # Rotation 0, 0, 0 (in axis-angle format).
|
||||
5.0, # Focal length in world size.
|
||||
2.0, # Sensor size in world size.
|
||||
|
||||
Reference in New Issue
Block a user