docstr: Initialize this model class.
  Parameters:
      opt -- training/test options
  A few things can be done here.
  - (required) call the initialization function of BaseModel
  - define loss function, visualization images, model names, and optimizers
docstr_tok: ["Initialize","this","model","class",".","Parameters",":","opt","--","training\/test","options","A","few","things","can","be","done","here",".","-","(","required",")","call","the","initialization","function","of","BaseModel","-","define","loss","function",",","visualization","images",",","model","names",",","and","optimizers"]
code: def __init__(self, option, model_type, dataset, modules):
      """Initialize this model class.
      Parameters:
          opt -- training/test options
      A few things can be done here.
      - (required) call the initialization function of BaseModel
      - define loss function, visualization images, model names, and optimizers
      """
      super(VoteNetModel, self).__init__(option)
      self._dataset = dataset
      self._weight_classes = dataset.weight_classes
  
      # 1 - CREATE BACKBONE MODEL
      input_nc = dataset.feature_dimension
      backbone_option = option.backbone
      backbone_cls = getattr(models, backbone_option.model_type)
      self.backbone_model = backbone_cls(
          architecture="unet", input_nc=input_nc, config=backbone_option
      )
  
      # 2 - CREATE VOTING MODEL
      voting_option = option.voting
      voting_cls = getattr(votenet_module, voting_option.module_name)
      self.voting_module = voting_cls(
          vote_factor=voting_option.vote_factor,
          seed_feature_dim=voting_option.feat_dim,
      )
  
      # 3 - CREATE PROPOSAL MODULE
      num_classes = dataset.num_classes
      proposal_option = option.proposal
      proposal_cls = getattr(
          votenet_module, proposal_option.module_name
      )
      self.proposal_cls_module = proposal_cls(
          num_class=num_classes,
          vote_aggregation_config=proposal_option.vote_aggregation,
          num_heading_bin=proposal_option.num_heading_bin,
          mean_size_arr=dataset.mean_size_arr,
          num_proposal=proposal_option.num_proposal,
          sampling=proposal_option.sampling,
      )
  
      # Loss params
      self.loss_params = option.loss_params
      self.loss_params.num_heading_bin = proposal_option.num_heading_bin
      mean_size_arr = dataset.mean_size_arr
      if isinstance(mean_size_arr, torch.Tensor):
          mean_size_arr = mean_size_arr.numpy().tolist()
      if isinstance(dataset.mean_size_arr, np.ndarray):
          mean_size_arr = mean_size_arr.tolist()
      self.loss_params.mean_size_arr = mean_size_arr
  
      self.losses_has_been_added = False
      self.loss_names = []
  
file_path: torch-points3d/torch_points3d/models/object_detection/votenet.py
imports: import logging
  import numpy
  import torch
  import os
  from torch_geometric.data import Data
  from torch_points3d.datasets.object_detection.box_data import BoxData
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.applications import models
  import torch_points3d.modules.VoteNet
  from torch_points3d.models.base_architectures import UnetBasedModel
  from torch_points3d.datasets.segmentation import IGNORE_LABEL
label_desc: Use image node_id 1 to create a new VoteNetModel object from inherited base classes: BaseModel with example: obj = VoteNetModel(option, model_type, dataset, modules)