mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-03 04:12:48 +08:00
Summary: Support variable size pointclouds in the renderer API to allow compatibility with Pulsar rasterizer. If radius is provided as a float, it is converted to a tensor of shape (P). Otherwise radius is expected to be an (N, P_padded) dimensional tensor where P_padded is the max number of points in the batch (following the convention from pulsar: https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/fbcode/frl/gemini/pulsar/pulsar/renderer.py?commit=ee0342850210e5df441e14fd97162675c70d147c&lines=50) Reviewed By: jcjohnson, gkioxari Differential Revision: D21429400 fbshipit-source-id: 65de7d9cd2472b27fc29f96160c33687e88098a2
25 lines
684 B
Python
25 lines
684 B
Python
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
|
|
|
import itertools
|
|
|
|
from fvcore.common.benchmark import benchmark
|
|
from test_cameras_alignment import TestCamerasAlignment
|
|
|
|
|
|
def bm_cameras_alignment() -> None:
|
|
|
|
case_grid = {
|
|
"batch_size": [10, 100, 1000],
|
|
"mode": ["centers", "extrinsics"],
|
|
"estimate_scale": [False, True],
|
|
}
|
|
test_cases = itertools.product(*case_grid.values())
|
|
kwargs_list = [dict(zip(case_grid.keys(), case)) for case in test_cases]
|
|
|
|
benchmark(
|
|
TestCamerasAlignment.corresponding_cameras_alignment,
|
|
"CORRESPONDING_CAMERAS_ALIGNMENT",
|
|
kwargs_list,
|
|
warmup_iters=1,
|
|
)
|