vis4d.eval.common.depth

Depth estimation evaluator.

Classes

DepthEvaluator([min_depth, max_depth, ...])

Depth estimation evaluator.

class DepthEvaluator(min_depth=0.0, max_depth=80.0, scale=1.0, epsilon=0.001)[source]

Depth estimation evaluator.

Initialize the optical flow evaluator.

Parameters:
  • min_depth (float) – Minimum depth to evaluate. Defaults to 0.001.

  • max_depth (float) – Maximum depth to evaluate. Defaults to 80.0.

  • scale (float) – Scale factor for depth. Defaults to 1.0.

  • epsilon (float) – Small value to avoid logarithms of small values. Defaults to 1e-3.

__repr__()[source]

Concise representation of the evaluator.

Return type:

str

evaluate(metric)[source]

Evaluate predictions.

Returns a dict containing the raw data and a short description string containing a readablae result.

Parameters:

metric (str) – Metric to use. See @property metric

Return type:

tuple[Dict[str, Union[float, int, Tensor]], str]

Returns:

metric_data, description tuple containing the metric data (dict with metric name and value) as well as a short string with shortened information.

Raises:
  • RuntimeError – if no data has been registered to be evaluated.

  • ValueError – if metric is not supported.

gather(gather_func)[source]

Accumulate predictions across processes.

Return type:

None

process_batch(prediction, groundtruth)[source]

Process a batch of data.

Parameters:
  • prediction (np.array) – Prediction optical flow, in shape (H, W, 2).

  • groundtruth (np.array) – Target optical flow, in shape (H, W, 2).

Return type:

None

reset()[source]

Reset evaluator for new round of evaluation.

Return type:

None

property metrics: list[str]

Supported metrics.