class_docstr: Base MS Coco dataset.
class_docstr_tok: ["Base","MS","Coco","dataset","."]
code: def _info(self):
      features = {
          # Images can have variable shape
          "image": tfds.features.Image(encoding_format="jpeg"),
          "image/filename": tfds.features.Text(),
          "image/id": tf.int64,
      }
      # Either uses panotptic or original annotations
      if self.builder_config.has_panoptic:
          features.update(
              {
                  "panoptic_image": tfds.features.Image(
                      encoding_format="png"
                  ),
                  "panoptic_image/filename": tfds.features.Text(),
                  "panoptic_objects": tfds.features.Sequence(
                      {
                          "id": np.int64,
                          # Coco has unique id for each annotation. The id can be used
                          # for mapping panoptic image to semantic segmentation label.
                          "area": np.int64,
                          "bbox": tfds.features.BBoxFeature(),
                          # Coco2017 has 200 categories but only 133 are present in the
                          # dataset
                          "label": tfds.features.ClassLabel(
                              num_classes=133
                          ),
                          "is_crowd": np.bool_,
                      }
                  ),
              }
          )
      else:
          features.update(
              {
                  "objects": tfds.features.Sequence(
                      {
                          "id": np.int64,
                          # Coco has unique id for each annotation. The id can be used
                          # for mapping panoptic image to semantic segmentation label.
                          "area": np.int64,
                          "bbox": tfds.features.BBoxFeature(),
                          # Coco has 91 categories but only 80 appear in the dataset
                          "label": tfds.features.ClassLabel(
                              num_classes=80
                          ),
                          "is_crowd": np.bool_,
                      }
                  ),
              }
          )
      # More info could be added, like segmentation (as png mask), captions,
      # person key-points, more metadata (original flickr url,...).
  
      return tfds.core.DatasetInfo(
          builder=self,
          description=_DESCRIPTION,
          # More info could be added, like the segmentation (as png mask),
          # captions, person key-points. For caption encoding, it would probably
          # be better to have a separate class CocoCaption2014 to avoid poluting
          # the main class with builder config for each encoder.
          features=tfds.features.FeaturesDict(features),
          homepage="http://cocodataset.org/#home",
          citation=_CITATION,
      )
  
imports: from __future__ import annotations
  import collections
  import json
  import os
  from absl import logging
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 1 for calling the Coco obj's underlying member method code with example usage: obj._info() and returns: tfds