nerfbaselines.evaluation

class nerfbaselines.evaluation.DefaultEvaluationProtocol[source]

Bases: EvaluationProtocol

accumulate_metrics(metrics: Iterable[Dict[str, float | int]]) Dict[str, float | int][source]
evaluate(predictions: Dict[str, ndarray], dataset: Dataset) Dict[str, float | int][source]
get_name()[source]
render(method: Method, dataset: Dataset, *, options=None) Dict[str, ndarray][source]
class nerfbaselines.evaluation.NerfEvaluationProtocol[source]

Bases: DefaultEvaluationProtocol

nerfbaselines.evaluation.build_evaluation_protocol(id: str) EvaluationProtocol[source]
nerfbaselines.evaluation.compute_metrics(pred: np.ndarray, gt: np.ndarray, *, reduce: Literal[True] = True, run_lpips_vgg: bool = False) Dict[str, float][source]
nerfbaselines.evaluation.compute_metrics(pred: np.ndarray, gt: np.ndarray, *, reduce: Literal[False], run_lpips_vgg: bool = False) Dict[str, np.ndarray]
nerfbaselines.evaluation.evaluate(predictions: str, output: str, description: str = 'evaluating', evaluation_protocol: EvaluationProtocol | None = None)[source]

Evaluate a set of predictions.

Parameters:
  • predictions – Path to a directory containing the predictions.

  • output – Path to a json file where the results will be written.

  • description – Description of the evaluation, used for progress bar.

  • evaluation_protocol – The evaluation protocol to use. If None, the protocol from info.json will be used.

Returns:

A dictionary containing the results.

nerfbaselines.evaluation.path_is_video(path: str) bool[source]
nerfbaselines.evaluation.render_all_images(method: Method, dataset: Dataset, output: str, description: str | None = 'rendering all images', nb_info: dict | None = None, evaluation_protocol: EvaluationProtocol | None = None) Iterable[Dict[str, ndarray]][source]
nerfbaselines.evaluation.render_frames(method: Method, cameras: Cameras, output: str | Path, fps: float, embeddings: List[ndarray] | None = None, description: str = 'rendering frames', output_names: Tuple[str, ...] = ('color',), nb_info: dict | None = None) None[source]
nerfbaselines.evaluation.run_inside_eval_container(backend_name: str | None = None)[source]

Ensures PyTorch is available to compute extra metrics (lpips)

nerfbaselines.evaluation.trajectory_get_cameras(trajectory: Trajectory) Cameras[source]
nerfbaselines.evaluation.trajectory_get_embeddings(method: Method, trajectory: Trajectory) List[ndarray] | None[source]
nerfbaselines.evaluation.with_supported_camera_models(supported_camera_models)[source]