code: def get_model(
      shape_centers, shape_sdfs, shape_pointclouds, dict_clusters
  ):
      """Get model."""
      kernel_regularization = None
      if (
          FLAGS.kernel_regularization == "l2"
          or FLAGS.kernel_regularization == "l1"
      ):
          kernel_regularization = FLAGS.kernel_regularization
  
      head_losses = {}
      head_losses["centers"] = {
          "loss": focal_loss.FocalLoss(),
          "weight": 1.0,
      }
      if FLAGS.predict_2d_box:
          head_losses["offset"] = {
              "loss": regression_l1_loss.RegL1Loss(),
              "weight": 1.0,
          }
          head_losses["width_height"] = {
              "loss": regression_l1_loss.RegL1Loss(),
              "weight": 0.1,
          }
      head_losses["sizes_3d"] = {
          "loss": regression_l1_loss.RegL1Loss(sparse=True),
          "weight": FLAGS.sizes_3d_weight,
      }
  
      if FLAGS.shapes_weight >= 0.0:
          if FLAGS.shape_focal_loss:
              head_losses["shapes"] = {
                  "loss": focal_loss_sparse.SparseFocalLoss(),
                  "weight": FLAGS.shapes_weight,
              }
          else:
              head_losses["shapes"] = {
                  "loss": cross_entropy_loss.CrossEntropyLoss(
                      label_smoothing=FLAGS.label_smoothing,
                      soft_shape_labels=FLAGS.soft_shape_labels,
                  ),
                  "weight": FLAGS.shapes_weight,
              }
      if FLAGS.translations_3d_weight >= 0.0:
          head_losses["translations_3d"] = {
              "loss": regression_l1_loss.RegL1Loss(sparse=True),
              "weight": FLAGS.translations_3d_weight,
          }
      if FLAGS.rotations_3d_weight >= 0.0:
          head_losses["rotations_3d"] = {
              "loss": regression_l1_loss.RegL1Loss(sparse=True),
              "weight": FLAGS.rotations_3d_weight,
          }
      if FLAGS.pose_pc_pc_weight >= 0.0:
          head_losses["pose_groundtruth_pointclouds"] = {
              "loss": regression_huber_loss.HuberLoss(),
              "weight": FLAGS.pose_pc_pc_weight,
          }
      if FLAGS.projected_pose_pc_pc_weight >= 0.0:
          head_losses["projected_gt_shapes"] = {
              "loss": regression_huber_loss.HuberLoss(),
              "weight": FLAGS.projected_pose_pc_pc_weight,
          }
      if FLAGS.collision_weight >= 0.0:
          head_losses["collisions_gt_shapes"] = {
              "loss": collision_loss.CollisionLoss(tol=-FLAGS.tol),
              "weight": FLAGS.collision_weight,
          }
      if FLAGS.shape_sdf_sdf_weight >= 0.0:
          head_losses["sdfs"] = {
              "loss": regression_huber_loss.HuberLoss(),
              "weight": FLAGS.shape_sdf_sdf_weight,
          }
  
      num_shapes = 300
      if "scannet" in FLAGS.tfrecords_dir:
          num_shapes = 50 * 8
  
      model = centernet_vid.CenterNetVID(
          heads_losses=head_losses,
          heads={
              "centers": {"dim": FLAGS.num_classes},
              "offset": {"dim": 2},
              "width_height": {"dim": 2},
              "sizes_offset_3d": {"dim": 3},
              "translations_offset_3d": {"dim": 3},
              "rotations_offset_3d": {"dim": 9},
              "shapes": {"dim": num_shapes},
          },
          input_shape=(None, FLAGS.image_height, FLAGS.image_width, 3),
          get_k_predictions_test=FLAGS.max_num_objects,
          score_threshold=FLAGS.score_threshold,
          number_hourglasses=FLAGS.number_hourglasses,
          kernel_regularization=kernel_regularization,
          clip_norm=FLAGS.gradient_clipping_norm,
          shape_centers=shape_centers,
          shape_sdfs=shape_sdfs,
          shape_pointclouds=shape_pointclouds,
          dict_clusters=dict_clusters,
          beta=FLAGS.beta,
          rotation_svd=FLAGS.rotation_svd,
      )
      model.batch_size = FLAGS.batch_size
      model.window_size = 1
      return model
  
imports: import os
  import pickle
  import time
  from absl import app
  from absl import flags
  from absl import logging
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorflow_graphics.projects.points_to_3Dobjects.data_preparation.extract_protos
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import collision_loss
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import cross_entropy_loss
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import focal_loss
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import focal_loss_sparse
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import learning_rate_schedule
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import regression_huber_loss
  from tensorflow_graphics.projects.points_to_3Dobjects.losses import regression_l1_loss
  import tensorflow_graphics.projects.points_to_3Dobjects.models.centernet_vid
  from tensorflow_graphics.projects.points_to_3Dobjects.transforms import transforms_factory
  from tensorflow_graphics.projects.points_to_3Dobjects.utils import evaluator
  import tensorflow_graphics.projects.points_to_3Dobjects.utils.io
  import tensorflow_graphics.projects.points_to_3Dobjects.utils.logger
  import tensorflow_graphics.projects.points_to_3Dobjects.utils.plot
  import tensorflow_graphics.projects.points_to_3Dobjects.utils.tf_utils
  from google3.pyglib import gfile
label_desc: Use image node_id 3 for calling a global function with example usage: get_model(shape_centers, shape_sdfs, shape_pointclouds, dict_clusters) and returns: model