code: def _mobilenet_v3(
      arch: str,
      pretrained: bool,
      rect_strides: Optional[List[str]] = None,
      ignore_keys: Optional[List[str]] = None,
      **kwargs: Any,
  ) -> mobilenetv3.MobileNetV3:
      kwargs["num_classes"] = kwargs.get(
          "num_classes", len(default_cfgs[arch]["classes"])
      )
      kwargs["classes"] = kwargs.get(
          "classes", default_cfgs[arch]["classes"]
      )
  
      _cfg = deepcopy(default_cfgs[arch])
      _cfg["num_classes"] = kwargs["num_classes"]
      _cfg["classes"] = kwargs["classes"]
      kwargs.pop("classes")
  
      if arch.startswith("mobilenet_v3_small"):
          model = mobilenetv3.mobilenet_v3_small(**kwargs, weights=None)
      else:
          model = mobilenetv3.mobilenet_v3_large(**kwargs, weights=None)
  
      # Rectangular strides
      if isinstance(rect_strides, list):
          for layer_name in rect_strides:
              m = model
              for child in layer_name.split("."):
                  m = getattr(m, child)
              m.stride = (2, 1)
  
      # Load pretrained parameters
      if pretrained:
          # The number of classes is not the same as the number of classes in the pretrained model =>
          # remove the last layer weights
          _ignore_keys = (
              ignore_keys
              if kwargs["num_classes"]
              != len(default_cfgs[arch]["classes"])
              else None
          )
          load_pretrained_params(
              model, default_cfgs[arch]["url"], ignore_keys=_ignore_keys
          )
  
      model.cfg = _cfg
  
      return model
  
file_path: doctr/doctr/models/classification/mobilenet/pytorch.py
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional
  from torchvision.models import mobilenetv3
  from doctr.datasets import VOCABS
  from ...utils import load_pretrained_params
label_desc: Use image node_id 1 for calling a global function with example usage: _mobilenet_v3(arch, pretrained, rect_strides, ignore_keys) and returns: model