class_docstr: Generates the training, validation, and testing dataset objects for
  a dataset laid out on disk like CO3Dv2, with annotations in gzipped json files.
  
  The dataset is organized in the filesystem as follows::
  
      self.dataset_root
          ├── <category_0>
          │   ├── <sequence_name_0>
          │   │   ├── depth_masks
          │   │   ├── depths
          │   │   ├── images
          │   │   ├── masks
          │   │   └── pointcloud.ply
          │   ├── <sequence_name_1>
          │   │   ├── depth_masks
          │   │   ├── depths
          │   │   ├── images
          │   │   ├── masks
          │   │   └── pointcloud.ply
          │   ├── ...
          │   ├── <sequence_name_N>
          │   ├── set_lists
          │       ├── set_lists_<subset_name_0>.json
          │       ├── set_lists_<subset_name_1>.json
          │       ├── ...
          │       ├── set_lists_<subset_name_M>.json
          │   ├── eval_batches
          │   │   ├── eval_batches_<subset_name_0>.json
          │   │   ├── eval_batches_<subset_name_1>.json
          │   │   ├── ...
          │   │   ├── eval_batches_<subset_name_M>.json
          │   ├── frame_annotations.jgz
          │   ├── sequence_annotations.jgz
          ├── <category_1>
          ├── ...
          ├── <category_K>
  
  The dataset contains sequences named `<sequence_name_i>` from `K` categories with
  names `<category_j>`. Each category comprises sequence folders
  `<category_k>/<sequence_name_i>` containing the list of sequence images, depth maps,
  foreground masks, and valid-depth masks `images`, `depths`, `masks`, and `depth_masks`
  respectively. Furthermore, `<category_k>/<sequence_name_i>/set_lists/` stores `M`
  json files `set_lists_<subset_name_l>.json`, each describing a certain sequence subset.
  
  Users specify the loaded dataset subset by setting `self.subset_name` to one of the
  available subset names `<subset_name_l>`.
  
  `frame_annotations.jgz` and `sequence_annotations.jgz` are gzipped json files containing
  the list of all frames and sequences of the given category stored as lists of
  `FrameAnnotation` and `SequenceAnnotation` objects respectivelly.
  
  Each `set_lists_<subset_name_l>.json` file contains the following dictionary::
  
      {
          "train": [
              (sequence_name: str, frame_number: int, image_path: str),
              ...
          ],
          "val": [
              (sequence_name: str, frame_number: int, image_path: str),
              ...
          ],
          "test": [
              (sequence_name: str, frame_number: int, image_path: str),
              ...
          ],
      ]
  
  defining the list of frames (identified with their `sequence_name` and `frame_number`)
  in the "train", "val", and "test" subsets of the dataset.
  Note that `frame_number` can be obtained only from `frame_annotations.jgz` and
  does not necesarrily correspond to the numeric suffix of the corresponding image
  file name (e.g. a file `<category_0>/<sequence_name_0>/images/frame00005.jpg` can
  have its frame number set to `20`, not 5).
  
  Each `eval_batches_<subset_name_l>.json` file contains a list of evaluation examples
  in the following form::
  
      [
          [  # batch 1
              (sequence_name: str, frame_number: int, image_path: str),
              ...
          ],
          [  # batch 1
              (sequence_name: str, frame_number: int, image_path: str),
              ...
          ],
      ]
  
  Note that the evaluation examples always come from the `"test"` subset of the dataset.
  (test frames can repeat across batches).
  
  Args:
      category: Dataset categories to load expressed as a string of comma-separated
          category names (e.g. `"apple,car,orange"`).
      subset_name: The name of the dataset subset. For CO3Dv2, these include
          e.g. "manyview_dev_0", "fewview_test", ...
      dataset_root: The root folder of the dataset.
      test_on_train: Construct validation and test datasets from
          the training subset.
      only_test_set: Load only the test set. Incompatible with `test_on_train`.
      load_eval_batches: Load the file containing eval batches pointing to the
          test dataset.
      n_known_frames_for_test: Add a certain number of known frames to each
          eval batch. Useful for evaluating models that require
          source views as input (e.g. NeRF-WCE / PixelNeRF).
      dataset_args: Specifies additional arguments to the
          JsonIndexDataset constructor call.
      path_manager_factory: (Optional) An object that generates an instance of
          PathManager that can translate provided file paths.
      path_manager_factory_class_type: The class type of `path_manager_factory`.
code: def create_dataset(self):
      # The dataset object is created inside `self.get_dataset_map`
      pass
  
imports: import copy
  import json
  import logging
  import multiprocessing
  import os
  import warnings
  from collections import defaultdict
  from typing import Dict, List, Optional, Tuple, Type, Union
  import numpy
  from iopath.common.file_io import PathManager
  from omegaconf import DictConfig
  from pytorch3d.implicitron.dataset.dataset_map_provider import DatasetMap, DatasetMapProviderBase, PathManagerFactory
  from pytorch3d.implicitron.dataset.json_index_dataset import JsonIndexDataset
  from pytorch3d.implicitron.tools.config import expand_args_fields, registry, run_auto_creation
  from pytorch3d.renderer.cameras import CamerasBase
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling the JsonIndexDatasetMapProviderV2 obj's underlying member method code with example usage: obj.create_dataset() without return types