code: def main(cfg):
      OmegaConf.set_struct(cfg, False)
  
      # Get device
      device = torch.device(
          "cuda" if (torch.cuda.is_available() and cfg.cuda) else "cpu"
      )
      log.info("DEVICE : {}".format(device))
  
      # Enable CUDNN BACKEND
      torch.backends.cudnn.enabled = cfg.enable_cudnn
  
      # Checkpoint
      checkpoint = ModelCheckpoint(
          cfg.checkpoint_dir,
          cfg.model_name,
          cfg.weight_name,
          strict=True,
      )
  
      # Setup the dataset config
      # Generic config
      train_dataset_cls = get_dataset_class(checkpoint.data_config)
      setattr(
          checkpoint.data_config,
          "class",
          train_dataset_cls.FORWARD_CLASS,
      )
      setattr(checkpoint.data_config, "dataroot", cfg.input_path)
  
      # Datset specific configs
      if cfg.data:
          for key, value in cfg.data.items():
              checkpoint.data_config.update(key, value)
      if cfg.dataset_config:
          for key, value in cfg.dataset_config.items():
              checkpoint.dataset_properties.update(key, value)
  
      # Create dataset and mdoel
      model = checkpoint.create_model(
          checkpoint.dataset_properties, weight_name=cfg.weight_name
      )
      log.info(model)
      log.info(
          "Model size = %i",
          sum(
              param.numel()
              for param in model.parameters()
              if param.requires_grad
          ),
      )
  
      # Set dataloaders
      dataset = instantiate_dataset(checkpoint.data_config)
      dataset.create_dataloaders(
          model,
          cfg.batch_size,
          cfg.shuffle,
          cfg.num_workers,
          False,
      )
      log.info(dataset)
  
      model.eval()
      if cfg.enable_dropout:
          model.enable_dropout_in_eval()
      model = model.to(device)
  
      # Run training / evaluation
      if not os.path.exists(cfg.output_path):
          os.makedirs(cfg.output_path)
  
      run(model, dataset, device, cfg.output_path)
  
file_path: torch-points3d/forward_scripts/forward.py
imports: import torch
  import hydra
  import logging
  from omegaconf import OmegaConf
  import os
  import sys
  import numpy
  from typing import Dict
  from torch_points3d.datasets.dataset_factory import instantiate_dataset, get_dataset_class
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.metrics.colored_tqdm import Coloredtqdm
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
  from torch_points3d.utils.colors import COLORS
label_desc: Use image node_id 3 for calling a global function with example usage: main(cfg) without return types