class_docstr: A class to build a FrameData object, load and process the binary data (crop and
  resize). This is an abstract class for extending to build FrameData subtypes. Most
  users need to use concrete `FrameDataBuilder` class instead.
  Beware that modifications of frame data are done in-place.
  
  Args:
      dataset_root: The root folder of the dataset; all paths in frame / sequence
          annotations are defined w.r.t. this root. Has to be set if any of the
          load_* flabs below is true.
      load_images: Enable loading the frame RGB data.
      load_depths: Enable loading the frame depth maps.
      load_depth_masks: Enable loading the frame depth map masks denoting the
          depth values used for evaluation (the points consistent across views).
      load_masks: Enable loading frame foreground masks.
      load_point_clouds: Enable loading sequence-level point clouds.
      max_points: Cap on the number of loaded points in the point cloud;
          if reached, they are randomly sampled without replacement.
      mask_images: Whether to mask the images with the loaded foreground masks;
          0 value is used for background.
      mask_depths: Whether to mask the depth maps with the loaded foreground
          masks; 0 value is used for background.
      image_height: The height of the returned images, masks, and depth maps;
          aspect ratio is preserved during cropping/resizing.
      image_width: The width of the returned images, masks, and depth maps;
          aspect ratio is preserved during cropping/resizing.
      box_crop: Enable cropping of the image around the bounding box inferred
          from the foreground region of the loaded segmentation mask; masks
          and depth maps are cropped accordingly; cameras are corrected.
      box_crop_mask_thr: The threshold used to separate pixels into foreground
          and background based on the foreground_probability mask; if no value
          is greater than this threshold, the loader lowers it and repeats.
      box_crop_context: The amount of additional padding added to each
          dimension of the cropping bounding box, relative to box size.
      path_manager: Optionally a PathManager for interpreting paths in a special way.
class_docstr_tok: ["A","class","to","build","a","FrameData","object",",","load","and","process","the","binary","data","(","crop","and","resize",")",".","This","is","an","abstract","class","for","extending","to","build","FrameData","subtypes",".","Most","users","need","to","use","concrete","`","FrameDataBuilder","`","class","instead",".","Beware","that","modifications","of","frame","data","are","done","in-place",".","Args",":","dataset_root",":","The","root","folder","of","the","dataset",";","all","paths","in","frame","\/","sequence","annotations","are","defined","w.r.t",".","this","root",".","Has","to","be","set","if","any","of","the","load_","*","flabs","below","is","true",".","load_images",":","Enable","loading","the","frame","RGB","data",".","load_depths",":","Enable","loading","the","frame","depth","maps",".","load_depth_masks",":","Enable","loading","the","frame","depth","map","masks","denoting","the","depth","values","used","for","evaluation","(","the","points","consistent","across","views",")",".","load_masks",":","Enable","loading","frame","foreground","masks",".","load_point_clouds",":","Enable","loading","sequence-level","point","clouds",".","max_points",":","Cap","on","the","number","of","loaded","points","in","the","point","cloud",";","if","reached",",","they","are","randomly","sampled","without","replacement",".","mask_images",":","Whether","to","mask","the","images","with","the","loaded","foreground","masks",";","0","value","is","used","for","background",".","mask_depths",":","Whether","to","mask","the","depth","maps","with","the","loaded","foreground","masks",";","0","value","is","used","for","background",".","image_height",":","The","height","of","the","returned","images",",","masks",",","and","depth","maps",";","aspect","ratio","is","preserved","during","cropping\/resizing",".","image_width",":","The","width","of","the","returned","images",",","masks",",","and","depth","maps",";","aspect","ratio","is","preserved","during","cropping\/resizing",".","box_crop",":","Enable","cropping","of","the","image","around","the","bounding","box","inferred","from","the","foreground","region","of","the","loaded","segmentation","mask",";","masks","and","depth","maps","are","cropped","accordingly",";","cameras","are","corrected",".","box_crop_mask_thr",":","The","threshold","used","to","separate","pixels","into","foreground","and","background","based","on","the","foreground_probability","mask",";","if","no","value","is","greater","than","this","threshold",",","the","loader","lowers","it","and","repeats",".","box_crop_context",":","The","amount","of","additional","padding","added","to","each","dimension","of","the","cropping","bounding","box",",","relative","to","box","size",".","path_manager",":","Optionally","a","PathManager","for","interpreting","paths","in","a","special","way","."]
docstr: Fix up a point cloud path from the dataset.
  Some files in Co3Dv2 have an accidental absolute path stored.
docstr_tok: ["Fix","up","a","point","cloud","path","from","the","dataset",".","Some","files","in","Co3Dv2","have","an","accidental","absolute","path","stored","."]
code: def _fix_point_cloud_path(self, path: str) -> str:
      """
      Fix up a point cloud path from the dataset.
      Some files in Co3Dv2 have an accidental absolute path stored.
      """
      unwanted_prefix = "/large_experiments/p3/replay/datasets/co3d/co3d45k_220512/export_v23/"
      if path.startswith(unwanted_prefix):
          path = path[len(unwanted_prefix) :]
      assert self.dataset_root is not None
      return os.path.join(self.dataset_root, path)
  
imports: import os
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from dataclasses import dataclass, field, fields
  from typing import Any, ClassVar, Generic, List, Mapping, Optional, Tuple, Type, TypeVar, Union
  import numpy
  import torch
  from pytorch3d.implicitron.dataset import types
  from pytorch3d.implicitron.dataset.utils import adjust_camera_to_bbox_crop_, adjust_camera_to_image_scale_, bbox_xyxy_to_xywh, clamp_box_to_image_bounds_and_round, crop_around_box, GenericWorkaround, get_bbox_from_mask, get_clamp_bbox, load_depth, load_depth_mask, load_image, load_mask, load_pointcloud, rescale_bbox, resize_image, safe_as_tensor
  from pytorch3d.implicitron.tools.config import registry, ReplaceableBase
  from pytorch3d.renderer.camera_utils import join_cameras_as_batch
  from pytorch3d.renderer.cameras import CamerasBase, PerspectiveCameras
  from pytorch3d.structures.pointclouds import join_pointclouds_as_batch, Pointclouds
label_desc: Use image node_id 7 for calling the GenericFrameDataBuilder obj's underlying member method code with example usage: obj._fix_point_cloud_path(path) and returns: os