vis4d.eval.metrics.depth

Depth estimation metrics.

Functions

absolute_error(prediction, target)

Compute the absolute error.

absolute_relative_error(prediction, target)

Compute the absolute relative error.

delta_p(prediction, target[, power])

Compute the delta_p metric.

log_10_error(prediction, target)

Compute the log_10 error.

root_mean_squared_error(prediction, target)

Compute the root mean squared error.

root_mean_squared_error_log(prediction, target)

Compute the root mean squared error in log space.

scale_invariant_log(prediction, target[, ...])

Compute the scale invariant log error.

squared_relative_error(prediction, target)

Compute the squared relative error.

absolute_error(prediction, target)[source]

Compute the absolute error.

Parameters:
  • prediction (NDArrayNumber) – Prediction depth map, in shape (…, H, W).

  • target (NDArrayNumber) – Target depth map, in shape (…, H, W).

Returns:

Absolute error.

Return type:

float

absolute_relative_error(prediction, target)[source]

Compute the absolute relative error.

Parameters:
  • prediction (NDArrayNumber) – Prediction depth map, in shape (…, H, W).

  • target (NDArrayNumber) – Target depth map, in shape (…, H, W).

Returns:

Absolute relative error.

Return type:

float

delta_p(prediction, target, power=1)[source]

Compute the delta_p metric.

Parameters:
  • prediction (ArrayLike) – Prediction depth map, in shape (H, W).

  • target (ArrayLike) – Target depth map, in shape (H, W).

  • power (float, optional) – Power of the threshold. Defaults to 1.

Returns:

Delta_p metric.

Return type:

float

log_10_error(prediction, target)[source]

Compute the log_10 error.

Parameters:
  • prediction (ArrayLike) – Prediction depth map, in shape (H, W).

  • target (ArrayLike) – Target depth map, in shape (H, W).

Returns:

Log_10 error.

Return type:

float

root_mean_squared_error(prediction, target)[source]

Compute the root mean squared error.

Parameters:
  • prediction (ArrayLike) – Prediction depth map, in shape (…, H, W).

  • target (ArrayLike) – Target depth map, in shape (…, H, W).

Returns:

Root mean squared error.

Return type:

float

root_mean_squared_error_log(prediction, target, epsilon=1e-08)[source]

Compute the root mean squared error in log space.

Parameters:
  • prediction (ArrayLike) – Prediction depth map, in shape (H, W).

  • target (ArrayLike) – Target depth map, in shape (H, W).

  • epsilon (float, optional) – Epsilon to avoid log(0). Defaults to 1e-6.

Returns:

Root mean squared error in log space.

Return type:

float

scale_invariant_log(prediction, target, epsilon=1e-08)[source]

Compute the scale invariant log error.

Parameters:
  • prediction (ArrayLike) – Prediction depth map, in shape (H, W).

  • target (ArrayLike) – Target depth map, in shape (H, W).

  • epsilon (float, optional) – Epsilon to avoid log(0). Defaults to 1e-6.

Returns:

Scale invariant log error.

Return type:

float

squared_relative_error(prediction, target)[source]

Compute the squared relative error.

Parameters:
  • prediction (NDArrayNumber) – Prediction depth map, in shape (…, H, W).

  • target (NDArrayNumber) – Target depth map, in shape (…, H, W).

Returns:

Square relative error.

Return type:

float