class_docstr: Class to handle camera geometry.
class_docstr_tok: ["Class","to","handle","camera","geometry","."]
docstr: Loads a JSON camera into memory.
docstr_tok: ["Loads","a","JSON","camera","into","memory","."]
code: def from_json(cls, path: types.PathType):
      """Loads a JSON camera into memory."""
      path = gpath.GPath(path)
      with path.open("r") as fp:
          camera_json = json.load(fp)
  
      # Fix old camera JSON.
      if "tangential" in camera_json:
          camera_json["tangential_distortion"] = camera_json[
              "tangential"
          ]
  
      return cls(
          orientation=np.asarray(camera_json["orientation"]),
          position=np.asarray(camera_json["position"]),
          focal_length=camera_json["focal_length"],
          principal_point=np.asarray(camera_json["principal_point"]),
          skew=camera_json["skew"],
          pixel_aspect_ratio=camera_json["pixel_aspect_ratio"],
          radial_distortion=np.asarray(
              camera_json["radial_distortion"]
          ),
          tangential_distortion=np.asarray(
              camera_json["tangential_distortion"]
          ),
          image_size=np.asarray(camera_json["image_size"]),
      )
  
imports: import copy
  import json
  from typing import Tuple, Union, Optional
  import numpy
  from nerfies import gpath
  from nerfies import types
label_desc: Use image node_id 2 for calling the Camera obj's underlying member method code with example usage: obj.from_json(cls, path) and returns: cls