code: def linknet_resnet18(
      pretrained: bool = False, **kwargs: Any
  ) -> LinkNet:
      """LinkNet as described in `"LinkNet: Exploiting Encoder Representations for Efficient Semantic Segmentation"
      <https://arxiv.org/pdf/1707.03718.pdf>`_.
  
      >>> import torch
      >>> from doctr.models import linknet_resnet18
      >>> model = linknet_resnet18(pretrained=True).eval()
      >>> input_tensor = torch.rand((1, 3, 1024, 1024), dtype=torch.float32)
      >>> out = model(input_tensor)
  
      Args:
      ----
          pretrained (bool): If True, returns a model pre-trained on our text detection dataset
          **kwargs: keyword arguments of the LinkNet architecture
  
      Returns:
      -------
          text detection architecture
      """
      return _linknet(
          "linknet_resnet18",
          pretrained,
          resnet18,
          ["layer1", "layer2", "layer3", "layer4"],
          ignore_keys=[
              "classifier.6.weight",
              "classifier.6.bias",
          ],
          **kwargs,
      )
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision.models._utils import IntermediateLayerGetter
  from doctr.file_utils import CLASS_NAME
  from doctr.models.classification import resnet18, resnet34, resnet50
  from ...utils import _bf16_to_float32, load_pretrained_params
  from .base import LinkNetPostProcessor, _LinkNet
label_desc: Use image node_id 2 for calling a global function with example usage: linknet_resnet18(pretrained) and returns: _linknet