code: def _check_load_coco_bbox(
      coco,
      entry: dict,
      min_object_area: Optional[Union[int, float]] = 0,
      use_crowd: Optional[bool] = False,
  ):
      """
      Check and load ground-truth labels. Modified from gluon cv.
  
      Parameters
      ----------
      coco
          The COCO data class.
      entry
          The image annotation entry.
      min_object_area
          Minimum object area to consider.
      use_crowd
          Use crowd or not.
  
      Returns
      -------
      Valid objects to consider.
      """
      entry_id = entry["id"]
      # fix pycocotools _isArrayLike which don't work for str in python3
      entry_id = (
          [entry_id]
          if not isinstance(entry_id, (list, tuple))
          else entry_id
      )
      ann_ids = coco.getAnnIds(imgIds=entry_id, iscrowd=None)
      objs = coco.loadAnns(ann_ids)
      # check valid bboxes
      rois = []
      is_crowds = []
      width = entry["width"]
      height = entry["height"]
      for obj in objs:
          if obj["area"] < min_object_area:
              continue
          if obj.get("ignore", 0) == 1:
              continue
          is_crowd = obj.get("iscrowd", 0)
          if not use_crowd and is_crowd:
              continue
          # convert from (x, y, w, h) to (xmin, ymin, xmax, ymax) and clip bound
          xmin, ymin, xmax, ymax = bbox_clip_xyxy(
              bbox_xywh_to_xyxy(obj["bbox"]), width, height
          )
          # require non-zero box area
          if obj["area"] > 0 and xmax > xmin and ymax > ymin:
              cat_ids = coco.getCatIds()
              id_to_idx = dict(zip(cat_ids, range(len(cat_ids))))
              class_label = id_to_idx[
                  coco.loadCats(obj["category_id"])[0]["id"]
              ]
              rois.append(
                  [
                      float(xmin),
                      float(ymin),
                      float(xmax),
                      float(ymax),
                      class_label,
                  ]
              )
              is_crowds.append(is_crowd)
      return rois, is_crowds
  
imports: import json
  import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Union
  import defusedxml.ElementTree
  import numpy
  import pandas
  import PIL
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from ..constants import BBOX, LABEL, MAP, MAP_50, MAP_75, MAP_LARGE, MAP_MEDIUM, MAP_SMALL, MAR_1, MAR_10, MAR_100, MAR_LARGE, MAR_MEDIUM, MAR_SMALL, MEAN_AVERAGE_PRECISION
  from .download import download, is_url
label_desc: Use image node_id 16 for calling a global function with example usage: _check_load_coco_bbox(coco, entry, min_object_area, use_crowd) and returns: rois,  is_crowds