code: def from_coco_or_voc(
      file_path: str, splits: Optional[Union[str]] = None
  ):
      """
      Convert the data from coco or voc format to pandas Dataframe.
  
      Parameters
      ----------
      file_path
          The path to data.
          If it is a file, it should be the COCO format json annotation file.
          If it is a directory, it should be the root folder of VOC format data.
      splits
          The splits to use for VOC format data.
  
      Returns
      -------
          The data in our pandas Dataframe format.
      """
      if os.path.isdir(file_path):
          # VOC use dir as input
          return from_voc(root=file_path, splits=splits)
      else:
          return from_coco(file_path)
  
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 26 for calling a global function with example usage: from_coco_or_voc(file_path, splits) and returns: from_voc, from_coco