code: def create_from_pcd(
      self, pcd: BasicPointCloud, spatial_lr_scale: float
  ):
      self.spatial_lr_scale = spatial_lr_scale
      fused_point_cloud = (
          torch.tensor(np.asarray(pcd.points)).float().cuda()
      )
      fused_color = RGB2SH(
          torch.tensor(np.asarray(pcd.colors)).float().cuda()
      )
      features = (
          torch.zeros(
              (fused_color.shape[0], 3, (self.max_sh_degree + 1) ** 2)
          )
          .float()
          .cuda()
      )
      features[:, :3, 0] = fused_color
      features[:, 3:, 1:] = 0.0
  
      print(
          "Number of points at initialisation : ",
          fused_point_cloud.shape[0],
      )
  
      dist2 = torch.clamp_min(
          distCUDA2(
              torch.from_numpy(np.asarray(pcd.points)).float().cuda()
          ),
          0.0000001,
      )
      scales = torch.log(torch.sqrt(dist2))[..., None].repeat(1, 3)
      rots = torch.zeros((fused_point_cloud.shape[0], 4), device="cuda")
      rots[:, 0] = 1
  
      opacities = inverse_sigmoid(
          0.1
          * torch.ones(
              (fused_point_cloud.shape[0], 1),
              dtype=torch.float,
              device="cuda",
          )
      )
  
      self._xyz = nn.Parameter(fused_point_cloud.requires_grad_(True))
      self._features_dc = nn.Parameter(
          features[:, :, 0:1]
          .transpose(1, 2)
          .contiguous()
          .requires_grad_(True)
      )
      self._features_rest = nn.Parameter(
          features[:, :, 1:]
          .transpose(1, 2)
          .contiguous()
          .requires_grad_(True)
      )
      self._scaling = nn.Parameter(scales.requires_grad_(True))
      self._rotation = nn.Parameter(rots.requires_grad_(True))
      self._opacity = nn.Parameter(opacities.requires_grad_(True))
      self.max_radii2D = torch.zeros(
          (self.get_xyz.shape[0]), device="cuda"
      )
  
imports: import torch
  import numpy
  from utils.general_utils import inverse_sigmoid, get_expon_lr_func, build_rotation
  from torch import nn
  import os
  from utils.system_utils import mkdir_p
  from plyfile import PlyData, PlyElement
  from utils.sh_utils import RGB2SH
  from simple_knn._C import distCUDA2
  from utils.graphics_utils import BasicPointCloud
  from utils.general_utils import strip_symmetric, build_scaling_rotation
label_desc: Use image node_id 12 for calling the GaussianModel obj's underlying member method code with example usage: obj.create_from_pcd(pcd, spatial_lr_scale) without return types