code: def adjust_camera_to_image_scale_(
      camera: PerspectiveCameras,
      original_size_wh: torch.Tensor,
      new_size_wh: torch.LongTensor,
  ) -> PerspectiveCameras:
      focal_length_px, principal_point_px = _convert_ndc_to_pixels(
          camera.focal_length[0],
          camera.principal_point[0],
          original_size_wh,
      )
  
      # now scale and convert from pixels to NDC
      image_size_wh_output = new_size_wh.float()
      scale = (
          (image_size_wh_output / original_size_wh)
          .min(dim=-1, keepdim=True)
          .values
      )
      focal_length_px_scaled = focal_length_px * scale
      principal_point_px_scaled = principal_point_px * scale
  
      (
          focal_length_scaled,
          principal_point_scaled,
      ) = _convert_pixels_to_ndc(
          focal_length_px_scaled,
          principal_point_px_scaled,
          image_size_wh_output,
      )
      camera.focal_length = focal_length_scaled[None]
      camera.principal_point = principal_point_scaled[None]
  
imports: import functools
  import warnings
  from pathlib import Path
  from typing import List, Optional, Tuple, TypeVar, Union
  import numpy
  import torch
  from PIL import Image
  from pytorch3d.io import IO
  from pytorch3d.renderer.cameras import PerspectiveCameras
  from pytorch3d.structures.pointclouds import Pointclouds
label_desc: Use image node_id 24 for calling a global function with example usage: adjust_camera_to_image_scale_(camera, original_size_wh, new_size_wh) without return types