nerfbaselines.utils

class nerfbaselines.utils.CancellationToken[source]

Bases: object

cancel()[source]
property cancelled
invoke(fn, *args, **kwargs)[source]
exception nerfbaselines.utils.CancelledException[source]

Bases: Exception

class nerfbaselines.utils.Formatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

format(record: LogRecord)[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

exception nerfbaselines.utils.NoGPUError(message='No GPUs available')[source]

Bases: RuntimeError

nerfbaselines.utils.assert_not_none(value: T | None) T[source]
nerfbaselines.utils.batched(array, batch_size)[source]
nerfbaselines.utils.cancellable(fn=None, mark_only=False) Any[source]
nerfbaselines.utils.cast_value(tp, value)[source]
nerfbaselines.utils.convert_image_dtype(image, dtype)[source]
nerfbaselines.utils.get_resources_utilization_info(pid=None)[source]
nerfbaselines.utils.handle_cli_error(fn)[source]
nerfbaselines.utils.image_to_srgb(tensor, dtype, color_space: str | None = None, allow_alpha: bool = False, background_color: ndarray | None = None)[source]
nerfbaselines.utils.is_broadcastable(shape1, shape2)[source]
nerfbaselines.utils.linear_to_srgb(img)[source]
nerfbaselines.utils.mark_host(fn)[source]
nerfbaselines.utils.padded_stack(tensors: ndarray | List[ndarray]) ndarray[source]
nerfbaselines.utils.partialclass(cls, *args, **kwargs)[source]
nerfbaselines.utils.partialmethod(func, *args, **kwargs)[source]
nerfbaselines.utils.read_image(file: BinaryIO | str | Path) ndarray[source]
nerfbaselines.utils.remap_error(fn)[source]
nerfbaselines.utils.save_depth(file: BinaryIO | str | Path, tensor: ndarray)[source]
nerfbaselines.utils.save_image(file: BinaryIO | str | Path, tensor: ndarray)[source]
nerfbaselines.utils.setup_logging(verbose: bool)[source]
nerfbaselines.utils.srgb_to_linear(img)[source]
nerfbaselines.utils.visualize_depth(depth: ~numpy.ndarray, expected_scale: float | None = None, near_far: ~numpy.ndarray | None = None, pallete: str = 'viridis', xnp=<module 'numpy' from '/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/numpy/__init__.py'>) ndarray[source]