Remove defaults from docstrings. (#480)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-19 10:04:25 -07:00
1 parent f796a9f468
commit 8b388a3e5c
25 files changed
+106 -112

No files matched your search

+2 -2
View File
@@ -256,8 +256,8 @@ class Cameras:
Args: Args:
camera_idx: Index of the camera to convert. camera_idx: Index of the camera to convert.
image: An image in range [0, 1] that is encoded to a base64 string. Defaults to None. image: An image in range [0, 1] that is encoded to a base64 string.
max_size: Max size to resize the image to. Defaults to None. max_size: Max size to resize the image to if present.
Returns: Returns:
A JSON representation of the camera A JSON representation of the camera
+8 -8
View File
@@ -128,7 +128,7 @@ class LocalWriterConfig(InstantiateConfig):
"""Instantiate local writer """Instantiate local writer
Args: Args:
banner_messages: List of strings that always print at the bottom of screen. Defaults to None. banner_messages: List of strings that always print at the bottom of screen.
""" """
return self._target(self, banner_messages=banner_messages, **kwargs) return self._target(self, banner_messages=banner_messages, **kwargs)
@@ -257,9 +257,9 @@ class ModelConfig(InstantiateConfig):
loss_coefficients: Dict[str, float] = to_immutable_dict({"rgb_loss_coarse": 1.0, "rgb_loss_fine": 1.0}) loss_coefficients: Dict[str, float] = to_immutable_dict({"rgb_loss_coarse": 1.0, "rgb_loss_fine": 1.0})
"""Loss specific weights.""" """Loss specific weights."""
num_coarse_samples: int = 64 num_coarse_samples: int = 64
"""Number of samples in coarse field evaluation. Defaults to 64""" """Number of samples in coarse field evaluation"""
num_importance_samples: int = 128 num_importance_samples: int = 128
"""Number of samples in fine field evaluation. Defaults to 128""" """Number of samples in fine field evaluation"""
enable_density_field: bool = False enable_density_field: bool = False
"""Whether to create a density field to filter samples.""" """Whether to create a density field to filter samples."""
density_field_params: Dict[str, Any] = to_immutable_dict( density_field_params: Dict[str, Any] = to_immutable_dict(
@@ -292,20 +292,20 @@ class NerfWModelConfig(ModelConfig):
) )
"""Loss specific weights.""" """Loss specific weights."""
num_coarse_samples: int = 64 num_coarse_samples: int = 64
"""Number of samples in coarse field evaluation. Defaults to 64,""" """Number of samples in coarse field evaluation."""
num_importance_samples: int = 64 num_importance_samples: int = 64
"""Number of samples in fine field evaluation. Defaults to 128,""" """Number of samples in fine field evaluation."""
uncertainty_min: float = 0.03 uncertainty_min: float = 0.03
"""This is added to the end of the uncertainty """This is added to the end of the uncertainty
rendering operation. It's called 'beta_min' in other repos. rendering operation. It's called 'beta_min' in other repos.
This avoids calling torch.log() on a zero value, which would be undefined. This avoids calling torch.log() on a zero value, which would be undefined.
Defaults to 0.03.""" """
num_images: int = 10000 # TODO: don't hardcode this num_images: int = 10000 # TODO: don't hardcode this
"""How many images exist in the dataset.""" """How many images exist in the dataset."""
appearance_embedding_dim: int = 48 appearance_embedding_dim: int = 48
"""Dimension of appearance embedding. Defaults to 48.""" """Dimension of appearance embedding."""
transient_embedding_dim: int = 16 transient_embedding_dim: int = 16
"""Dimension of transient embedding. Defaults to 16.""" """Dimension of transient embedding."""
@dataclass @dataclass
+3 -3
View File
@@ -36,9 +36,9 @@ class CacheImageDataloader(DataLoader):
Args: Args:
dataset: Dataset to sample from. dataset: Dataset to sample from.
num_samples_to_collate: How many images to sample rays for each batch. Defaults to all images. num_samples_to_collate: How many images to sample rays for each batch. -1 for all images.
num_times_to_repeat_images: How often to collate new images. Defaults to every iteration. num_times_to_repeat_images: How often to collate new images.
device: Device to perform computation. Defaults to "cpu". device: Device to perform computation.
""" """
def __init__( def __init__(
@@ -42,7 +42,7 @@ class InstantNGPDataParserConfig(DataParserConfig):
scale_factor: float = 1.0 scale_factor: float = 1.0
"""How much to scale the camera origins by.""" """How much to scale the camera origins by."""
scene_scale: float = 0.33 scene_scale: float = 0.33
"""How much to scale the scene. Defaults to 0.33""" """How much to scale the scene."""
@dataclass @dataclass
@@ -38,13 +38,13 @@ class MipNerf360DataParserConfig(DataParserConfig):
data_directory: Path = Path("data/mipnerf_360/garden") data_directory: Path = Path("data/mipnerf_360/garden")
"""directory specifying location of data""" """directory specifying location of data"""
downscale_factor: int = 1 downscale_factor: int = 1
"""How much to downscale images. Defaults to 1.""" """How much to downscale images."""
val_skip: int = 8 val_skip: int = 8
"""1/val_skip images to use for validation. Defaults to 8.""" """1/val_skip images to use for validation."""
auto_scale: bool = True auto_scale: bool = True
"""Scale based on pose bounds. Defaults to True.""" """Scale based on pose bounds."""
aabb_scale: float = 4 aabb_scale: float = 4
"""Scene scale, Defaults to 1.0.""" """Scene scale."""
@dataclass @dataclass
@@ -42,15 +42,13 @@ class NerfactoryDataParserConfig(DataParserConfig):
scale_factor: float = 1.0 scale_factor: float = 1.0
"""How much to scale the camera origins by.""" """How much to scale the camera origins by."""
downscale_factor: int = 1 downscale_factor: int = 1
"""How much to downscale images. Defaults to 1.""" """How much to downscale images."""
scene_scale: float = 4.0 scene_scale: float = 4.0
"""How much to scale the scene. Defaults to 4.0""" """How much to scale the scene."""
orientation_method: Literal["pca", "up"] = "up" orientation_method: Literal["pca", "up"] = "up"
"""The method to use for orientation. Either "pca" or "up".""" """The method to use for orientation."""
train_split_percentage: float = 0.9 train_split_percentage: float = 0.9
""" """The percent of images to use for training. The remaining images are for eval.
The percent of images to use for training.
The remaining images are for eval. Defaults to 0.9.
""" """
@@ -40,14 +40,14 @@ class Record3DDataParserConfig(DataParserConfig):
data_directory: Path = Path("data/record3d/garden") data_directory: Path = Path("data/record3d/garden")
"""Location of data""" """Location of data"""
val_skip: int = 8 val_skip: int = 8
"""1/val_skip images to use for validation. Defaults to 8.""" """1/val_skip images to use for validation."""
aabb_scale: float = 4.0 aabb_scale: float = 4.0
"""Scene scale, Defaults to 4.0.""" """Scene scale."""
orientation_method: Literal["pca", "up"] = "up" orientation_method: Literal["pca", "up"] = "up"
"""The method to use for orientation. Either "pca" or "up".""" """The method to use for orientation"""
max_dataset_size: int = 150 max_dataset_size: int = 150
"""Max number of images to train on. If the dataset has """Max number of images to train on. If the dataset has
more, images will be sampled approximately evenly. Defaults to 150.""" more, images will be sampled approximately evenly."""
@dataclass @dataclass
+2 -2
View File
@@ -66,8 +66,8 @@ class Trainer:
Args: Args:
config: The configuration object. config: The configuration object.
local_rank: Local rank of the process. Defaults to 0. local_rank: Local rank of the process.
world_size: World size of the process. Defaults to 1. world_size: World size of the process.
""" """
def __init__(self, config: cfg.Config, local_rank: int = 0, world_size: int = 1): def __init__(self, config: cfg.Config, local_rank: int = 0, world_size: int = 1):
+17 -17
View File
@@ -68,8 +68,8 @@ class ScalingAndOffset(Encoding):
Args: Args:
in_dim: Input dimension of tensor in_dim: Input dimension of tensor
scaling: Scaling applied to tensor. Defaults to 1.0. scaling: Scaling applied to tensor.
offset: Offset applied to tensor. Defaults to 0.0. offset: Offset applied to tensor.
""" """
def __init__(self, in_dim: int, scaling: float = 1.0, offset: float = 0.0) -> None: def __init__(self, in_dim: int, scaling: float = 1.0, offset: float = 0.0) -> None:
@@ -127,7 +127,7 @@ class NeRFEncoding(Encoding):
Args: Args:
in_tensor: For best performance, the input tensor should be between 0 and 1. in_tensor: For best performance, the input tensor should be between 0 and 1.
covs: Covariances of input points. Defaults to None. covs: Covariances of input points.
Returns: Returns:
Output values will be between -1 and 1 Output values will be between -1 and 1
""" """
@@ -186,7 +186,7 @@ class RFFEncoding(Encoding):
Args: Args:
in_tensor: For best performance, the input tensor should be between 0 and 1. in_tensor: For best performance, the input tensor should be between 0 and 1.
covs: Covariances of input points. Defaults to None. covs: Covariances of input points.
Returns: Returns:
Output values will be between -1 and 1 Output values will be between -1 and 1
@@ -212,12 +212,12 @@ class HashEncoding(Encoding):
"""Hash encoding """Hash encoding
Args: Args:
num_levels: Number of feature grids. Defaults to 16. num_levels: Number of feature grids.
min_res: Resolution of smallest feature grid. Defaults to 16. min_res: Resolution of smallest feature grid.
max_res: Resolution of largest feature grid. Defaults to 1024. max_res: Resolution of largest feature grid.
hash_table_size: Size of hash table. Defaults to 2**19. hash_table_size: Size of hash table.
features_per_level: Number of features per level. Defaults to 2. features_per_level: Number of features per level.
hash_init_scale: Value to initialize hash grid. Defaults to 0.001. hash_init_scale: Value to initialize hash grid.
""" """
def __init__( def __init__(
@@ -313,9 +313,9 @@ class TensorCPEncoding(Encoding):
"""Learned CANDECOMP/PARFAC (CP) decomposition encoding used in TensoRF """Learned CANDECOMP/PARFAC (CP) decomposition encoding used in TensoRF
Args: Args:
resolution: Resolution of grid. Defaults to 256. resolution: Resolution of grid.
num_components: Number of components per dimension. Defaults to 24. num_components: Number of components per dimension.
init_scale: Initialization scale. Defaults to 0.1. init_scale: Initialization scale.
""" """
def __init__(self, resolution: int = 256, num_components: int = 24, init_scale: float = 0.1) -> None: def __init__(self, resolution: int = 256, num_components: int = 24, init_scale: float = 0.1) -> None:
@@ -363,9 +363,9 @@ class TensorVMEncoding(Encoding):
"""Learned vector-matrix encoding proposed by TensoRF """Learned vector-matrix encoding proposed by TensoRF
Args: Args:
resolution: Resolution of grid. Defaults to 256. resolution: Resolution of grid.
num_components: Number of components per dimension. Defaults to 24. num_components: Number of components per dimension.
init_scale: Initialization scale. Defaults to 0.1. init_scale: Initialization scale.
""" """
plane_coef: TensorType[3, "num_components", "resolution", "resolution"] plane_coef: TensorType[3, "num_components", "resolution", "resolution"]
@@ -427,7 +427,7 @@ class SHEncoding(Encoding):
"""Spherical harmonic encoding """Spherical harmonic encoding
Args: Args:
levels: Number of spherical hamonic levels to encode. Defaults to 4. levels: Number of spherical hamonic levels to encode.
""" """
def __init__(self, levels: int = 4) -> None: def __init__(self, levels: int = 4) -> None:
+2 -2
View File
@@ -117,9 +117,9 @@ class SHFieldHead(FieldHead):
Args: Args:
in_dim: input dimension. If not defined in constructor, it must be set later. in_dim: input dimension. If not defined in constructor, it must be set later.
levels: Number of spherical harmonics layers. Defaults to 3. levels: Number of spherical harmonics layers.
channels: Number of channels. Defaults to 3 (ie RGB). channels: Number of channels. Defaults to 3 (ie RGB).
activation: Output activation. Defaults to None. activation: Output activation.
""" """
def __init__( def __init__(
+3 -3
View File
@@ -31,9 +31,9 @@ class MLP(FieldModule):
in_dim: Input layer dimension in_dim: Input layer dimension
num_layers: Number of network layers num_layers: Number of network layers
layer_width: Width of each MLP layer layer_width: Width of each MLP layer
out_dim: Ouput layer dimension. Defaults to layer_width out_dim: Ouput layer dimension. Uses layer_width if None.
activation: intermediate layer activation function. Defaults to nn.ReLU. activation: intermediate layer activation function.
out_activation: output activation function. Defaults to None. out_activation: output activation function.
""" """
def __init__( def __init__(
+9 -9
View File
@@ -38,15 +38,15 @@ class NeRFField(Field):
"""NeRF Field """NeRF Field
Args: Args:
position_encoding: Position encoder. Defaults to Identity(in_dim=3). position_encoding: Position encoder.
direction_encoding: Direction encoder. Defaults to Identity(in_dim=3). direction_encoding: Direction encoder.
base_mlp_num_layers: Number of layers for base MLP. Defaults to 8. base_mlp_num_layers: Number of layers for base MLP.
base_mlp_layer_width: Width of base MLP layers. Defaults to 256. base_mlp_layer_width: Width of base MLP layers.
head_mlp_num_layers: Number of layer for ourput head MLP. Defaults to 2. head_mlp_num_layers: Number of layer for ourput head MLP.
head_mlp_layer_width: Width of output head MLP layers. Defaults to 128. head_mlp_layer_width: Width of output head MLP layers.
skip_connections: Where to add skip connection in base MLP. Defaults to (4,). skip_connections: Where to add skip connection in base MLP.
use_integrated_encoding: Used integrated samples as encoding input, Defaults to False. use_integrated_encoding: Used integrated samples as encoding input.
spatial_distortion: Spatial distortion. Defaults to None. spatial_distortion: Spatial distortion.
""" """
def __init__( def __init__(
+10 -10
View File
@@ -40,15 +40,15 @@ class VanillaNerfWField(Field):
Args: Args:
num_images: How many images exist in the dataset. num_images: How many images exist in the dataset.
position_encoding: Position encoder. Defaults to Identity(in_dim=3). position_encoding: Position encoder.
direction_encoding: Direction encoder. Defaults to Identity(in_dim=3). direction_encoding: Direction encoder.
base_mlp_num_layers: Number of layers for base MLP. Defaults to 8. base_mlp_num_layers: Number of layers for base MLP.
base_mlp_layer_width: Width of base MLP layers. Defaults to 256. base_mlp_layer_width: Width of base MLP layers.
head_mlp_num_layers: Number of layer for ourput head MLP. Defaults to 2. head_mlp_num_layers: Number of layer for ourput head MLP.
head_mlp_layer_width: Width of output head MLP layers. Defaults to 128. head_mlp_layer_width: Width of output head MLP layers.
appearance_embedding_dim:: Dimension of appearance embedding. Defaults to 48. appearance_embedding_dim:: Dimension of appearance embedding.
transient_embedding_dim:: Dimension of transient embedding. Defaults to 16. transient_embedding_dim:: Dimension of transient embedding.
skip_connections: Where to add skip connection in base MLP. Defaults to (4,). skip_connections: Where to add skip connection in base MLP.
""" """
def __init__( def __init__(
@@ -121,7 +121,7 @@ class VanillaNerfWField(Field):
Args: Args:
ray_samples (RaySamples): Ray samples. ray_samples (RaySamples): Ray samples.
density_embedding (TensorType[..., "embedding_size"], optional): Density embedding. Defaults to None. density_embedding (TensorType[..., "embedding_size"], optional): Density embedding.
Returns: Returns:
Dict[FieldHeadNames, TensorType]: Outputs of the NeRF-W field. Dict[FieldHeadNames, TensorType]: Outputs of the NeRF-W field.
+7 -7
View File
@@ -38,13 +38,13 @@ class SemanticNerfField(Field):
Args: Args:
num_semantic_classes: Number of distinct semantic classes. num_semantic_classes: Number of distinct semantic classes.
position_encoding: Position encoder. Defaults to Identity(in_dim=3). position_encoding: Position encoder.
direction_encoding: Direction encoder. Defaults to Identity(in_dim=3). direction_encoding: Direction encoder.
base_mlp_num_layers: Number of layers for base MLP. Defaults to 8. base_mlp_num_layers: Number of layers for base MLP.
base_mlp_layer_width: Width of base MLP layers. Defaults to 256. base_mlp_layer_width: Width of base MLP layers.
head_mlp_num_layers: Number of layer for ourput head MLP. Defaults to 2. head_mlp_num_layers: Number of layer for ourput head MLP.
head_mlp_layer_width: Width of output head MLP layers. Defaults to 128. head_mlp_layer_width: Width of output head MLP layers.
skip_connections: Where to add skip connection in base MLP. Defaults to (4,). skip_connections: Where to add skip connection in base MLP.
""" """
def __init__( def __init__(
+4 -4
View File
@@ -239,11 +239,11 @@ class PDFSampler(Sampler):
Args: Args:
num_samples: Number of samples per ray num_samples: Number of samples per ray
train_stratified: Randomize location within each bin during training. Defaults to True train_stratified: Randomize location within each bin during training.
include_original: Add original samples to ray. Defaults to True include_original: Add original samples to ray.
density_field: Density grid. If provides, samples below weight_threshold as set as invalid. density_field: Density grid. If provides, samples below weight_threshold as set as invalid.
weight_threshold: Removes samples below threshold weight. Only used if density field is provided. weight_threshold: Removes samples below threshold weight. Only used if density field is provided.
histogram_padding: Amount to weights prior to computing PDF. Defaults to 0.01. histogram_padding: Amount to weights prior to computing PDF.
""" """
def __init__( def __init__(
@@ -276,7 +276,7 @@ class PDFSampler(Sampler):
ray_samples: Existing ray samples ray_samples: Existing ray samples
weights: Weights for each bin weights: Weights for each bin
num_samples: Number of samples per ray num_samples: Number of samples per ray
eps: Small value to prevent numerical issues. Defaults to 1e-5 eps: Small value to prevent numerical issues.
Returns: Returns:
Positions and deltas for samples along a ray Positions and deltas for samples along a ray
-1
View File
@@ -65,7 +65,6 @@ class NerfWModel(Model):
uncertainty_min (float, optional): This is added to the end of the uncertainty uncertainty_min (float, optional): This is added to the end of the uncertainty
rendering operation. It's called 'beta_min' in other repos. rendering operation. It's called 'beta_min' in other repos.
This avoids calling torch.log() on a zero value, which would be undefined. This avoids calling torch.log() on a zero value, which would be undefined.
Defaults to 0.03.
""" """
self.field_coarse = None self.field_coarse = None
self.field_fine = None self.field_fine = None
+2 -2
View File
@@ -29,8 +29,8 @@ class ExponentialDecaySchedule(LambdaLR):
lr_init: The initial learning rate. lr_init: The initial learning rate.
lr_final: The final learning rate. lr_final: The final learning rate.
max_steps: The maximum number of steps. max_steps: The maximum number of steps.
lr_delay_steps: The number of steps to delay the learning rate. Default is 0. lr_delay_steps: The number of steps to delay the learning rate.
lr_delay_mult: The multiplier for the learning rate after the delay. Default is 1.0. lr_delay_mult: The multiplier for the learning rate after the delay.
""" """
def __init__(self, optimizer, lr_init, lr_final, max_steps, lr_delay_steps=0, lr_delay_mult=1.0) -> None: def __init__(self, optimizer, lr_init, lr_final, max_steps, lr_delay_steps=0, lr_delay_mult=1.0) -> None:
+7 -9
View File
@@ -27,7 +27,7 @@ Example:
""" """
import math import math
from typing import Optional from typing import Literal, Optional
import nerfacc import nerfacc
import torch import torch
@@ -42,7 +42,7 @@ class RGBRenderer(nn.Module):
"""Standard volumetic rendering. """Standard volumetic rendering.
Args: Args:
background_color: Background color as RGB. Defaults to random. background_color: Background color as RGB. Uses random colors if None.
""" """
def __init__(self, background_color: Optional[TensorType[3]] = None) -> None: def __init__(self, background_color: Optional[TensorType[3]] = None) -> None:
@@ -63,7 +63,7 @@ class RGBRenderer(nn.Module):
Args: Args:
rgb: RGB for each sample rgb: RGB for each sample
weights: Weights for each sample weights: Weights for each sample
background_color: Background color as RGB. Defaults to random. background_color: Background color as RGB. Uses random colors if None.
ray_indices: Ray index for each sample, used when samples are packed. ray_indices: Ray index for each sample, used when samples are packed.
num_rays: Number of rays, used when samples are packed. num_rays: Number of rays, used when samples are packed.
@@ -115,8 +115,8 @@ class SHRenderer(nn.Module):
"""Render RGB value from spherical harmonics. """Render RGB value from spherical harmonics.
Args: Args:
background_color: Background color as RGB. Defaults to random. background_color: Background color as RGB. Uses random colors if None
activation: Output activation. Defaults to Sigmoid(). activation: Output activation.
""" """
def __init__( def __init__(
@@ -191,13 +191,11 @@ class DepthRenderer(nn.Module):
"""Calculate depth along ray. """Calculate depth along ray.
Args: Args:
method (str, optional): Depth calculation method. Defaults to 'expected'. method (str, optional): Depth calculation method.
""" """
def __init__(self, method: str = "expected") -> None: def __init__(self, method: Literal["expected"] = "expected") -> None:
super().__init__() super().__init__()
if method not in {"expected"}:
raise ValueError(f"{method} is an invalid depth calculation method")
self.method = method self.method = method
def forward( def forward(
+1 -1
View File
@@ -75,7 +75,7 @@ def get_git_root(path: str, dirs: Tuple[str] = (".git",), default: str = "") ->
Args: Args:
path: The path to start from. path: The path to start from.
dirs: The directories to look for. Defaults to (".git",). dirs: The directories to look for.
default: The default value to return if no git root is found. default: The default value to return if no git root is found.
Returns: Returns:
+7 -7
View File
@@ -28,7 +28,7 @@ def apply_colormap(image: TensorType["bs":..., 1], cmap="viridis") -> TensorType
Args: Args:
image: Single channel image. image: Single channel image.
cmap: Colormap for image. Defaults to 'turbo'. cmap: Colormap for image.
Returns: Returns:
TensorType: Colored image TensorType: Colored image
@@ -55,10 +55,10 @@ def apply_depth_colormap(
Args: Args:
depth: Depth image. depth: Depth image.
accumulation: Ray accumulation used for masking vis. Defaults to None. accumulation: Ray accumulation used for masking vis.
near_plane: Closest depth to consider. If None, use min image value. Defaults to None. near_plane: Closest depth to consider. If None, use min image value.
far_plane: Furthest depth to consider. If None, use max image value. Defaults to None. far_plane: Furthest depth to consider. If None, use max image value.
cmap: Colormap to apply. Defaults to "turbo". cmap: Colormap to apply.
Returns: Returns:
Colored depth image Colored depth image
@@ -88,8 +88,8 @@ def apply_boolean_colormap(
Args: Args:
image: Boolean image. image: Boolean image.
true_color: Color to use for True. Defaults to white. true_color: Color to use for True.
false_color: Color to use for False. Defaults to black. false_color: Color to use for False.
Returns: Returns:
Colored boolean image Colored boolean image
+1 -1
View File
@@ -38,7 +38,7 @@ def run_viewer_bridge_server_as_subprocess(zmq_port: int, websocket_port: int, l
Args: Args:
zmq_port: Port to use for the ZMQ server. zmq_port: Port to use for the ZMQ server.
websocket_port: Port to use for the websocket server. websocket_port: Port to use for the websocket server.
log_filename: Filename to use for the log file. Defaults to None. If None, no log file is created. log_filename: Filename to use for the log file. If None, no log file is created.
Returns: Returns:
None None
+2 -2
View File
@@ -90,8 +90,8 @@ class Viewer:
"""Viewer class for connecting to the bridge server. """Viewer class for connecting to the bridge server.
Args: Args:
zmq_url: Where to connect with ZMQ. Defaults to None. zmq_url: Where to connect with ZMQ.
window: An already existing ViewerWindow. Defaults to None. window: An already existing ViewerWindow.
""" """
def __init__(self, zmq_url: Optional[str] = None, window: Optional[ViewerWindow] = None): def __init__(self, zmq_url: Optional[str] = None, window: Optional[ViewerWindow] = None):
+1 -1
View File
@@ -18,7 +18,7 @@ def run_command(command: str, continue_on_fail: bool = False) -> bool:
Args: Args:
command: command to run command: command to run
continue_on_fail: whether to continue running commands if the current one fails. Defaults to False. continue_on_fail: whether to continue running commands if the current one fails.
""" """
ret_code = subprocess.call(command, shell=True) ret_code = subprocess.call(command, shell=True)
if ret_code != 0: if ret_code != 0:
+1 -2
View File
@@ -110,8 +110,7 @@ def _render_trajectory_video(
output_filename: Name of the output file. output_filename: Name of the output file.
rendered_output_name: Name of the renderer output to use. rendered_output_name: Name of the renderer output to use.
rendered_resolution_scaling_factor: Scaling factor to apply to the camera image resolution. rendered_resolution_scaling_factor: Scaling factor to apply to the camera image resolution.
Defaults to 1.0. seconds: Number for the output video.
seconds: Number for the output video. Defaults to 5.0.
""" """
console.print("[bold green]Creating trajectory video") console.print("[bold green]Creating trajectory video")
images = [] images = []
+4 -4
View File
@@ -126,10 +126,10 @@ def launch(
main_func (Callable): function that will be called by the distributed workers main_func (Callable): function that will be called by the distributed workers
num_gpus_per_machine (int): number of GPUs per machine num_gpus_per_machine (int): number of GPUs per machine
num_machines (int, optional): total number of machines num_machines (int, optional): total number of machines
machine_rank (int, optional): rank of this machine. Defaults to 0. machine_rank (int, optional): rank of this machine.
dist_url (str, optional): url to connect to for distributed jobs. Defaults to "auto". dist_url (str, optional): url to connect to for distributed jobs.
config (Config, optional): config file specifying training regimen. Defaults to None. config (Config, optional): config file specifying training regimen.
timeout (timedelta, optional): timeout of the distributed workers. Defaults to DEFAULT_TIMEOUT. timeout (timedelta, optional): timeout of the distributed workers.
""" """
assert config is not None assert config is not None
world_size = num_machines * num_gpus_per_machine world_size = num_machines * num_gpus_per_machine