pytorch3d/tests/bm_main.py
Christoph Lassner b19fe1de2f pulsar integration.
Summary:
This diff integrates the pulsar renderer source code into PyTorch3D as an alternative backend for the PyTorch3D point renderer. This diff is the first of a series of three diffs to complete that migration and focuses on the packaging and integration of the source code.

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`.

Tasks addressed in the following diffs:
* Add the PyTorch3D interface,
* Add notebook examples and documentation (or adapt the existing ones to feature both interfaces).

Reviewed By: nikhilaravi

Differential Revision: D23947736

fbshipit-source-id: a5e77b53e6750334db22aefa89b4c079cda1b443
2020-11-03 13:06:35 -08:00

35 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import glob
import os
import subprocess
import sys
from os.path import dirname, isfile, join
if __name__ == "__main__":
# pyre-ignore[16]
if len(sys.argv) > 1:
# Parse from flags.
# pyre-ignore[16]
file_names = [
join(dirname(__file__), n) for n in sys.argv if n.startswith("bm_")
]
else:
# Get all the benchmark files (starting with "bm_").
bm_files = glob.glob(join(dirname(__file__), "bm_*.py"))
file_names = sorted(
f for f in bm_files if isfile(f) and not f.endswith("bm_main.py")
)
# Forward all important path information to the subprocesses through the
# environment.
os.environ["PATH"] = sys.path[0] + ":" + os.environ.get("PATH", "")
os.environ["LD_LIBRARY_PATH"] = (
sys.path[0] + ":" + os.environ.get("LD_LIBRARY_PATH", "")
)
os.environ["PYTHONPATH"] = ":".join(sys.path)
for file_name in file_names:
subprocess.check_call([sys.executable, file_name])