code: def find_label_issues(
      labels: List[Dict[str, Any]],
      predictions: List[np.ndarray],
      *,
      return_indices_ranked_by_score: Optional[bool] = False,
      overlapping_label_check: Optional[bool] = True,
  ) -> np.ndarray:
      """
      Identifies potentially mislabeled images in an object detection dataset.
      An image is flagged with a label issue if *any* of its bounding boxes appear incorrectly annotated.
      This includes images for which a bounding box: should have been annotated but is missing,
      has been annotated with the wrong class, or has been annotated in a suboptimal location.
  
      Suppose the dataset has ``N`` images, ``K`` possible class labels.
      If ``return_indices_ranked_by_score`` is ``False``, a boolean mask of length ``N`` is returned,
      indicating whether each image has a label issue (``True``) or not (``False``).
      If ``return_indices_ranked_by_score`` is ``True``, the indices of images flagged with label issues are returned,
      sorted with the most likely-mislabeled images ordered first.
  
      Parameters
      ----------
      labels:
          Annotated boxes and class labels in the original dataset, which may contain some errors.
          This is a list of ``N`` dictionaries such that ``labels[i]`` contains the given labels for the `i`-th image in the following format:
          ``{'bboxes': np.ndarray((L,4)), 'labels': np.ndarray((L,)), 'image_name': str}`` where ``L`` is the number of annotated bounding boxes
          for the `i`-th image and ``bboxes[l]`` is a bounding box of coordinates in ``[x1,y1,x2,y2]`` format with given class label ``labels[j]``.
          ``image_name`` is an optional part of the labels that can be used to later refer to specific images.
  
         For more information on proper labels formatting, check out the `MMDetection library <https://mmdetection.readthedocs.io/en/dev-3.x/advanced_guides/customize_dataset.html>`_.
  
      predictions:
          Predictions output by a trained object detection model.
          For the most accurate results, predictions should be out-of-sample to avoid overfitting, eg. obtained via :ref:`cross-validation <pred_probs_cross_val>`.
          This is a list of ``N`` ``np.ndarray`` such that ``predictions[i]`` corresponds to the model prediction for the `i`-th image.
          For each possible class ``k`` in 0, 1, ..., K-1: ``predictions[i][k]`` is a ``np.ndarray`` of shape ``(M,5)``,
          where ``M`` is the number of predicted bounding boxes for class ``k``. Here the five columns correspond to ``[x1,y1,x2,y2,pred_prob]``,
          where ``[x1,y1,x2,y2]`` are coordinates of the bounding box predicted by the model
          and ``pred_prob`` is the model's confidence in the predicted class label for this bounding box.
  
          Note: Here, ``[x1,y1]`` corresponds to the coordinates of the bottom-left corner of the bounding box, while ``[x2,y2]`` corresponds to the coordinates of the top-right corner of the bounding box. The last column, pred_prob, represents the predicted probability that the bounding box contains an object of the class k.
  
          For more information see the `MMDetection package <https://github.com/open-mmlab/mmdetection>`_ for an example object detection library that outputs predictions in the correct format.
  
      return_indices_ranked_by_score:
          Determines what is returned by this method (see description of return value for details).
  
      overlapping_label_check : bool, default = True
         If True, boxes annotated with more than one class label have their swap score penalized.  Set this to False if you are not concerned when two very similar boxes exist with different class labels in the given annotations.
  
  
      Returns
      -------
      label_issues : np.ndarray
          Specifies which images are identified to have a label issue.
          If ``return_indices_ranked_by_score = False``, this function returns a boolean mask of length ``N`` (``True`` entries indicate which images have label issue).
          If ``return_indices_ranked_by_score = True``, this function returns a (shorter) array of indices of images with label issues, sorted by how likely the image is mislabeled.
  
          More precisely, indices are sorted by image label quality score calculated via :py:func:`object_detection.rank.get_label_quality_scores <cleanlab.object_detection.rank.get_label_quality_scores>`.
      """
      scoring_method = "objectlab"
  
      assert_valid_inputs(
          labels=labels,
          predictions=predictions,
          method=scoring_method,
      )
  
      is_issue = _find_label_issues(
          labels,
          predictions,
          scoring_method=scoring_method,
          return_indices_ranked_by_score=return_indices_ranked_by_score,
          overlapping_label_check=overlapping_label_check,
      )
  
      return is_issue
  
file_path: cleanlab/cleanlab/object_detection/filter.py
imports: from collections import defaultdict
  from multiprocessing import Pool
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from cleanlab.internal.constants import ALPHA, HIGH_PROBABILITY_THRESHOLD, LOW_PROBABILITY_THRESHOLD, OVERLOOKED_THRESHOLD_FACTOR, BADLOC_THRESHOLD_FACTOR, SWAP_THRESHOLD_FACTOR, AP_SCALE_FACTOR
  from cleanlab.internal.object_detection_utils import assert_valid_inputs
  from cleanlab.object_detection.rank import _get_valid_inputs_for_compute_scores, _separate_label, _separate_prediction, compute_badloc_box_scores, compute_overlooked_box_scores, compute_swap_box_scores, get_label_quality_scores, issues_from_scores, _get_overlap_matrix
label_desc: Use image node_id 1 for calling a global function with example usage: find_label_issues(labels, predictions) and returns: is_issue