Welcome to our Support Center

IoU

Description

Computes the Intersection-Over-Union metric for specific target classes. Type : polymorphic.

 

 

Input parameters

 

 y_pred : array, predicted values.
 y_true : array, true values.

parameters : cluster,

target_class_ids : array, list of target class ids for which the metric is returned.
sparse_y_true : boolean, whether labels are encoded using integers or one hot logits. If True labels are integers and if False, labels are one hot logits and the argmax function will be used to determine each sample’s most likely associated label according to “axis” parameters.
sparse_y_pred : boolean, whether predictions are encoded using integers or one hot logits. If True predictions are integers and if False, predictions are one hot logits and the argmax function will be used to determine each sample’s most likely associated label according to “axis” parameters.
 axis : integer, the dimension containing the logits.

Output parameters

 

iou : float, result.

Use cases

The IoU metric, which stands for Intersection over Union, is a widely used metric in computer vision, specifically for object detection and semantic segmentation tasks. It measures the correspondence between two sets, which are usually two areas in an image. In the context of object detection, these two sets are usually the ground truth (the actual location of the object in the image) and the model prediction (the location of the object as predicted by the model).

Calculation

This metric first computes IoUs for all individual classes, then returns the mean of IoUs for the classes that are specified by “target_class_ids”.

She gives a value between 0 and 1. A value of 0 means that there is no overlap at all, while a value of 1 means that there is perfect overlap (the two bounding boxes are exactly the same).

 

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install HAIBAL library to run it).

Easy to use with one_hot

Easy to use with sparse

Table of Contents