code: def get_sorted_bbox_count_idxs(labels, predictions):
      """
      Returns a tuple of idxs and bounding box counts of images sorted from highest to lowest number of bounding boxes.
  
      This plot can help you discover images with abnormally many/few object annotations.
  
      Parameters
      ----------
      labels:
          Annotated boxes and class labels in the original dataset, which may contain some errors.
          Refer to documentation for this argument in :py:func:`object_counts_per_image <cleanlab.object_detection.summary.object_counts_per_image>` for further details.
  
      predictions:
          Predictions output by a trained object detection model.
          Refer to documentation for this argument in :py:func:`object_counts_per_image <cleanlab.object_detection.summary.object_counts_per_image>` for further details.
  
  
      Returns
      -------
      sorted_idxs: List[Tuple[int, int]], List[Tuple[int, int]]
          A tuple containing two lists. The first is an array of shape ``(N,)`` containing the number of annotated objects for each image in the dataset.
          The second is an array of shape ``(N,)`` containing the number of predicted objects for each image in the dataset.
      """
      lab_count, pred_count = object_counts_per_image(
          labels, predictions
      )
      lab_grouped = list(enumerate(lab_count))
      pred_grouped = list(enumerate(pred_count))
  
      sorted_lab = sorted(lab_grouped, key=lambda x: x[1], reverse=True)
      sorted_pred = sorted(
          pred_grouped, key=lambda x: x[1], reverse=True
      )
  
      return sorted_lab, sorted_pred
  
imports: from multiprocessing import Pool
  from typing import Optional, Any, Dict, Tuple, Union, List, TYPE_CHECKING, TypeVar, DefaultDict
  import numpy
  import collections
  from cleanlab.internal.constants import MAX_CLASS_TO_SHOW, ALPHA, EPSILON, TINY_VALUE
  from cleanlab.object_detection.filter import _filter_by_class, _calculate_true_positives_false_positives
  from cleanlab.object_detection.rank import _get_valid_inputs_for_compute_scores, _separate_prediction, _separate_label, _get_prediction_type
  from cleanlab.internal.object_detection_utils import bbox_xyxy_to_xywh
label_desc: Use image node_id 4 for calling a global function with example usage: get_sorted_bbox_count_idxs(labels, predictions) and returns: sorted_lab,  sorted_pred