class_docstr: Creates a criterion to measure Jaccard loss:
  
  .. math:: L(A, B) = 1 - \frac{A \cap B}{A \cup B}
  
  Args:
      class_weights: Array (``np.array``) of class weights (``len(weights) = num_classes``).
      class_indexes: Optional integer or list of integers, classes to consider, if ``None`` all classes are used.
      per_image: If ``True`` loss is calculated for each image in batch and then averaged,
          else loss is calculated for the whole batch.
      smooth: Value to avoid division by zero.
  
  Returns:
       A callable ``jaccard_loss`` instance. Can be used in ``model.compile(...)`` function
       or combined with other losses.
  
  Example:
  
  .. code:: python
  
      loss = JaccardLoss()
      model.compile('SGD', loss=loss)
class_docstr_tok: ["Creates","a","criterion","to","measure","Jaccard","loss",":","..","math",":",":","L","(","A",",","B",")","=","1","-","\\frac","{","A","\\cap","B","}","{","A","\\cup","B","}","Args",":","class_weights",":","Array","(","``","np.array","``",")","of","class","weights","(","``","len","(","weights",")","=","num_classes","``",")",".","class_indexes",":","Optional","integer","or","list","of","integers",",","classes","to","consider",",","if","``","None","``","all","classes","are","used",".","per_image",":","If","``","True","``","loss","is","calculated","for","each","image","in","batch","and","then","averaged",",","else","loss","is","calculated","for","the","whole","batch",".","smooth",":","Value","to","avoid","division","by","zero",".","Returns",":","A","callable","``","jaccard_loss","``","instance",".","Can","be","used","in","``","model.compile","(","...",")","``","function","or","combined","with","other","losses",".","Example",":","..","code",":",":","python","loss","=","JaccardLoss","(",")","model.compile","(","'SGD","'",",","loss=loss",")"]
code: def __call__(self, gt, pr):
      return 1 - F.iou_score(
          gt,
          pr,
          class_weights=self.class_weights,
          class_indexes=self.class_indexes,
          smooth=self.smooth,
          per_image=self.per_image,
          threshold=None,
          **self.submodules,
      )
  
imports: from .base import Loss
  from .base import functional
label_desc: Use image node_id 2 for calling the JaccardLoss obj's underlying member method code with example usage: obj.__call__(gt, pr) and returns: unknown