class_docstr: Base class for different image classification models
class_docstr_tok: ["Base","class","for","different","image","classification","models"]
docstr: Helper function to build a model.
  
  Args:
      opts: Command-line arguments
  
  Returns:
      An instance of `cvnets.models.BaseAnyNNModel`.
docstr_tok: ["Helper","function","to","build","a","model",".","Args",":","opts",":","Command-line","arguments","Returns",":","An","instance","of","`","cvnets.models.BaseAnyNNModel","`","."]
code: def build_model(
      cls, opts: argparse.Namespace, *args, **kwargs
  ) -> BaseAnyNNModel:
      """Helper function to build a model.
  
      Args:
          opts: Command-line arguments
  
      Returns:
          An instance of `cvnets.models.BaseAnyNNModel`.
      """
      default_opt_info = set_model_specific_opts_before_model_building(
          opts
      )
      model = cls(opts, *args, **kwargs)
  
      unset_model_specific_opts_after_model_building(
          opts, default_opt_info
      )
  
      if getattr(opts, "model.classification.freeze_batch_norm"):
          cls.freeze_norm_layers(opts=opts, model=model)
      return model
  
imports: import argparse
  from typing import Any, Dict, List, Mapping, Optional, Tuple
  import torch
  from torch import Tensor, nn
  from torch.utils.checkpoint import checkpoint
  from common import is_test_env
  from cvnets.layers import LinearLayer
  from cvnets.misc.init_utils import initialize_fc_layer
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel
  from cvnets.neural_augmentor import build_neural_augmentor
  from utils import logger
label_desc: Use image node_id 14 for calling the BaseImageEncoder obj's underlying member method code with example usage: obj.build_model(cls, opts) and returns: model