utils.evaluate.SODAeval

utils.evaluate.SODAeval#

class SODAeval(labelmap: List[str])[source]#

Bases: object

Model evaluation tool

The add method accumulates predictions. The get_eval method can be used to obtain current results for the accumulated predictions.

The COCO API is used for evaluation.

Parameters:

labelmap (List[str]) – List of class names.

Methods

add

Add new predictions

get_eval

Calculates network scores and prints the results to the console

reset

Resets accumulated data

add(gts: Tensor, preds: Tensor, img: Tensor) None[source]#

Add new predictions

Parameters:
  • gts (torch.Tensor) –

    Ground Truth. Shape [batch, anchor, 5].

    One record contains(class id, xlu, ylu, xrd, yrd).

  • preds (torch.Tensor) –

    Shape [batch, anchor, 6].

    One preds contains (class, iou, xlu, ylu, xrd, yrd)

  • img (torch.Tensor) – Input img. Shape [batch, channels, h, w].

get_eval() None[source]#

Calculates network scores and prints the results to the console

reset() None[source]#

Resets accumulated data