class_docstr: Wandb class for 3D point clouds.
  
  Arguments:
      data_or_path: (numpy array, string, io)
          Object3D can be initialized from a file or a numpy array.
  
          You can pass a path to a file or an io object and a file_type
          which must be one of SUPPORTED_TYPES
  
  The shape of the numpy array must be one of either:
  ```
  [[x y z],       ...] nx3
  [[x y z c],     ...] nx4 where c is a category with supported range [1, 14]
  [[x y z r g b], ...] nx6 where is rgb is color
  ```
code: def __init__(
      self,
      data_or_path: Union["np.ndarray", str, "TextIO", dict],
      **kwargs: Optional[Union[str, "FileFormat3D"]],
  ) -> None:
      super().__init__()
  
      if hasattr(data_or_path, "name"):
          # if the file has a path, we just detect the type and copy it from there
          data_or_path = data_or_path.name
  
      if hasattr(data_or_path, "read"):
          if hasattr(data_or_path, "seek"):
              data_or_path.seek(0)
          object_3d = data_or_path.read()
  
          extension = kwargs.pop("file_type", None)
          if extension is None:
              raise ValueError(
                  "Must pass file type keyword argument when using io objects."
              )
          if extension not in Object3D.SUPPORTED_TYPES:
              raise ValueError(
                  "Object 3D only supports numpy arrays or files of the type: "
                  + ", ".join(Object3D.SUPPORTED_TYPES)
              )
  
          extension = "." + extension
  
          tmp_path = os.path.join(
              MEDIA_TMP.name, runid.generate_id() + extension
          )
          with open(tmp_path, "w") as f:
              f.write(object_3d)
  
          self._set_file(tmp_path, is_tmp=True, extension=extension)
      elif isinstance(data_or_path, str):
          path = data_or_path
          extension = None
          for supported_type in Object3D.SUPPORTED_TYPES:
              if path.endswith(supported_type):
                  extension = "." + supported_type
                  break
  
          if not extension:
              raise ValueError(
                  "File '"
                  + path
                  + "' is not compatible with Object3D: supported types are: "
                  + ", ".join(Object3D.SUPPORTED_TYPES)
              )
  
          self._set_file(
              data_or_path, is_tmp=False, extension=extension
          )
      # Supported different types and scene for 3D scenes
      elif isinstance(data_or_path, dict) and "type" in data_or_path:
          if data_or_path["type"] == "lidar/beta":
              data = {
                  "type": data_or_path["type"],
                  "vectors": data_or_path["vectors"].tolist()
                  if "vectors" in data_or_path
                  else [],
                  "points": data_or_path["points"].tolist()
                  if "points" in data_or_path
                  else [],
                  "boxes": data_or_path["boxes"].tolist()
                  if "boxes" in data_or_path
                  else [],
              }
          else:
              raise ValueError(
                  "Type not supported, only 'lidar/beta' is currently supported"
              )
  
          tmp_path = os.path.join(
              MEDIA_TMP.name, runid.generate_id() + ".pts.json"
          )
          with codecs.open(tmp_path, "w", encoding="utf-8") as fp:
              json.dump(
                  data,
                  fp,
                  separators=(",", ":"),
                  sort_keys=True,
                  indent=4,
              )
          self._set_file(tmp_path, is_tmp=True, extension=".pts.json")
      elif util.is_numpy_array(data_or_path):
          np_data = data_or_path
  
          # The following assertion is required for numpy to trust that
          # np_data is numpy array. The reason it is behind a False
          # guard is to ensure that this line does not run at runtime,
          # which would cause a runtime error if the user's machine did
          # not have numpy installed.
  
          if TYPE_CHECKING:
              assert isinstance(np_data, np.ndarray)
  
          if len(np_data.shape) != 2 or np_data.shape[1] not in {
              3,
              4,
              6,
          }:
              raise ValueError(
                  """
                      The shape of the numpy array must be one of either
                                      [[x y z],       ...] nx3
                                       [x y z c],     ...] nx4 where c is a category with supported range [1, 14]
                                       [x y z r g b], ...] nx6 where rgb is color
                      """
              )
  
          list_data = np_data.tolist()
          tmp_path = os.path.join(
              MEDIA_TMP.name, runid.generate_id() + ".pts.json"
          )
          with codecs.open(tmp_path, "w", encoding="utf-8") as fp:
              json.dump(
                  list_data,
                  fp,
                  separators=(",", ":"),
                  sort_keys=True,
                  indent=4,
              )
          self._set_file(tmp_path, is_tmp=True, extension=".pts.json")
      else:
          raise ValueError(
              "data must be a numpy array, dict or a file object"
          )
  
imports: import codecs
  import json
  import os
  import sys
  from typing import TYPE_CHECKING, ClassVar, Optional, Sequence, Set, TextIO, Tuple, Type, Union
  import wandb
  from wandb import util
  from wandb.sdk.lib import runid
  from wandb.sdk.lib.paths import LogicalPath
  from .None import _dtypes
  from ._private import MEDIA_TMP
  from .base_types.media import BatchableMedia
label_desc: Use image node_id 1 to create a new Object3D object from inherited base classes: BatchableMedia with example: obj = Object3D(data_or_path)