|
facebook360_dep
Facebook360 Depth Estimation Pipeline
|
Classes | |
| class | RepeatedTimer |
Functions | |
| def | init_facebook360_dep (gflags) |
| def | set_glog_env (gflags) |
| def | setup_logging_handler (log_dir) |
| def | terminate_handler () |
| def | sigterm_handler (signal, frame) |
| def | setup_termination_handlers (sigterm_handler=sigterm_handler) |
| def | define_flags () |
| def | log_flags () |
| def | docker_mounts (input_root, host_to_docker_path, username, password) |
| def | docker_run_cmd (ip, docker_img=config.DOCKER_IMAGE) |
| def | configure_worker_daemon (ip) |
| def | spawn_worker (ip, num_containers, run_async) |
| def | spawn_worker_local (replica) |
| def | setup_master (base_params) |
| def | setup_workers (base_params) |
| def | cleanup_workers () |
Variables | |
| dir_scripts = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| dir_root = os.path.dirname(dir_scripts) | |
| FLAGS = flags.FLAGS | |
| flag_names = set() | |
| list | child_pids = [] |
| facebook360_dep_root = str(Path(os.path.abspath(__file__)).parents[2]) | |
| source_root = os.path.join(facebook360_dep_root, "source") | |
| depth_est_src = os.path.join(source_root, "depth_estimation") | |
| dictionary | bin_to_flags |
| def scripts.render.setup.cleanup_workers | ( | ) |
Destroys the worker process if running locally.
| def scripts.render.setup.configure_worker_daemon | ( | ip | ) |
Configures the Docker daemon to accept HTTP connections for using the local registry.
Args:
ip (str): IP of the worker.
| def scripts.render.setup.define_flags | ( | ) |
Defines abseil flags for render.
| def scripts.render.setup.docker_mounts | ( | input_root, | |
| host_to_docker_path, | |||
| username, | |||
| password | |||
| ) |
Constructs a list of the relevant commands to mount the external paths.
The mounts are performed as commands if on a LAN and are volume mounts if
for a single node.
Args:
input_root (str): Path to the root of inputs.
host_to_docker_path (dict[str, str]): Map of local paths to path inside container.
username (str): Username for SMB drive. Can be blank if no username is used
for the drive or if rendering locally.
password (str): Password for SMB drive. Can be blank if no password is used
for the drive or if rendering locally.
Returns:
list[str]: List of Docker mount commands
| def scripts.render.setup.docker_run_cmd | ( | ip, | |
docker_img = config.DOCKER_IMAGE |
|||
| ) |
Constructs the command to run the Docker container. The container will map all
the desired endpoints to the canonical structure internally.
Args:
ip (str): IP of the master.
docker_img (str, optional): Name of the docker image.
Returns:
str: Command to run the configured Docker container.
| def scripts.render.setup.init_facebook360_dep | ( | gflags | ) |
Sets up the environment with expected values and handlers.
Args:
gflags (absl.flags._flagvalues.FlagValues): Globally defined flags.
| def scripts.render.setup.log_flags | ( | ) |
Prints formatted list of flags and their values.
| def scripts.render.setup.set_glog_env | ( | gflags | ) |
Sets up GLOG environment variables.
Args:
gflags (absl.flags._flagvalues.FlagValues): Globally defined flags.
| def scripts.render.setup.setup_logging_handler | ( | log_dir | ) |
Sets up logging.
Args:
log_dir (str): Path to directory where logs should be saved.
| def scripts.render.setup.setup_master | ( | base_params | ) |
Sets up the master node for rendering.
Args:
base_params (dict[str, _]): Map of all the FLAGS defined in render.py.
| def scripts.render.setup.setup_termination_handlers | ( | sigterm_handler = sigterm_handler | ) |
Sets up a handler for all termination signals.
Args:
sigterm_handler (func: (signal.signal, frame) -> void, optional): Function for handling
termination signals.
| def scripts.render.setup.setup_workers | ( | base_params | ) |
Sets up the worker nodes for rendering.
Args:
base_params (dict[str, _]): Map of all the FLAGS defined in render.py.
| def scripts.render.setup.sigterm_handler | ( | signal, | |
| frame | |||
| ) |
Handler for any catchable signal that terminates the program.
Args:
signal (signal.signal): Type of signal.
frame (frame): Stack frame.
| def scripts.render.setup.spawn_worker | ( | ip, | |
| num_containers, | |||
| run_async | |||
| ) |
Creates worker container(s) on the desired IP.
Args:
ip (str): IP of the machine to run the worker container.
num_containers (int): Number of containers to be run.
run_async (bool): Whether the spawning should happen synchronously or not.
| def scripts.render.setup.spawn_worker_local | ( | replica | ) |
Starts a worker locally.
Args:
replica (int): Replica ID of the worker being spawned.
| def scripts.render.setup.terminate_handler | ( | ) |
Cleans workers before terminating the program.
| dictionary scripts.render.setup.bin_to_flags |
| list scripts.render.setup.child_pids = [] |
| scripts.render.setup.depth_est_src = os.path.join(source_root, "depth_estimation") |
| scripts.render.setup.dir_root = os.path.dirname(dir_scripts) |
| scripts.render.setup.dir_scripts = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| scripts.render.setup.facebook360_dep_root = str(Path(os.path.abspath(__file__)).parents[2]) |
| scripts.render.setup.flag_names = set() |
| scripts.render.setup.FLAGS = flags.FLAGS |
| scripts.render.setup.source_root = os.path.join(facebook360_dep_root, "source") |
1.8.15