class_docstr: ObjectDetection dataset as DataFrame.
  
  Parameters
  ----------
  data : the input for pd.DataFrame
      The input data.
  dataset_type : str, optional
      The dataset type, can be voc/coco or more, used to annotate the optional fields.
  classes : list of str, optional
      The class synsets for this dataset, if `None`, it will infer from the data.
class_docstr_tok: ["ObjectDetection","dataset","as","DataFrame",".","Parameters","--","--","--","--","--","data",":","the","input","for","pd.DataFrame","The","input","data",".","dataset_type",":","str",",","optional","The","dataset","type",",","can","be","voc\/coco","or","more",",","used","to","annotate","the","optional","fields",".","classes",":","list","of","str",",","optional","The","class","synsets","for","this","dataset",",","if","`","None","`",",","it","will","infer","from","the","data","."]
docstr: Convert object-centric entries to image-centric entries.
  Where multiple entries belonging to single image can be merged to rois column.
  
  The length of returned dataframe is the number of images in the dataset.
code: def pack(self):
      """Convert object-centric entries to image-centric entries.
      Where multiple entries belonging to single image can be merged to rois column.
  
      The length of returned dataframe is the number of images in the dataset.
      """
      if self.is_packed():
          return self
      orig_classes = self.classes
      rois_columns = [
          "class",
          "xmin",
          "ymin",
          "xmax",
          "ymax",
          "difficult",
      ]
      image_attr_columns = ["width", "height"]
      new_df = (
          self.groupby(["image"], as_index=False)
          .agg(list)
          .reset_index(drop=True)
      )
      new_df["rois"] = new_df.apply(
          lambda y: [
              {
                  k: y.loc[k][i]
                  for k in rois_columns
                  if k in new_df.columns
              }
              for i in range(len(y.loc["class"]))
          ],
          axis=1,
      )
      new_df = new_df.drop(rois_columns, axis=1, errors="ignore")
      new_df["image_attr"] = new_df.agg(
          lambda y: {
              k: y[new_df.columns.get_loc(k)][0]
              for k in image_attr_columns
              if k in new_df.columns
          },
          axis=1,
      )
      new_df = new_df.drop(image_attr_columns, axis=1, errors="ignore")
      new_df = self.__class__(new_df.reset_index(drop=True))
      new_df.classes = orig_classes
      return new_df
  
imports: import logging
  import os
  from pathlib import Path
  import warnings
  import numpy
  import pandas
  import matplotlib.pyplot
  from PIL import Image
  import cv2
  from ..data import is_url, url_data
  from ...utils.filesystem import import_try_install
  from ...utils.bbox import bbox_xywh_to_xyxy, bbox_clip_xyxy
label_desc: Use image node_id 7 for calling the ObjectDetectionDataset obj's underlying member method code with example usage: obj.pack() and returns: new_df, self