# davisinteractive.metrics.jaccard

## batched_jaccard

batched_jaccard(y_true, y_pred, average_over_objects=True, nb_objects=None)

Jaccard similarity over two subsets of binary elements A and B:

\mathcal{J} = \frac{A \cap B}{A \cup B}

**Arguments**

**y_true**: Numpy Array. Array of shape (B x H x W) and type integer giving the ground truth of the object instance segmentation.**y_pred**: Numpy Array. Array of shape (B x H x W) and type integer giving the prediction of the object segmentation.**average_over_objects**: Boolean. Weather or not to average the jaccard over all the objects in the sequence. Default True.**nb_objects**: Integer. Number of objects in the ground truth mask. If`None`

the value will be infered from`y_true`

. Setting this value will speed up the computation.

**Returns**

`ndarray`

: Returns an array of shape (B) with the average jaccard for
all instances at each frame if `average_over_objects=True`

. If
`average_over_objects=False`

returns an array of shape (B x nObj)
with nObj being the number of objects on `y_true`

.

## batched_f_measure

batched_f_measure(y_true, y_pred, average_over_objects=True, nb_objects=None, bound_th=0.008)

**Arguments**

**y_true**: Numpy Array. Array of shape (B x H x W) and type integer giving the ground truth of the object instance segmentation.**y_pred**: Numpy Array. Array of shape (B x H x W) and type integer giving the prediction of the object segmentation.**average_over_objects**: Boolean. Weather or not to average the F-measure over all the objects in the sequence. Default True.**nb_objects**: Integer. Number of objects in the ground truth mask. If`None`

the value will be infered from`y_true`

. Setting this value will speed up the computation.

**Returns**

`ndarray`

: Returns an array of shape (B) with the average F-measure for
all instances at each frame if `average_over_objects=True`

. If
`average_over_objects=False`

returns an array of shape (B x nObj)
with nObj being the number of objects on `y_true`

.