class_docstr: Key.Net model definition -- local feature detector (response function). This is based on the original code
  from paper "Key.Net: Keypoint Detection by Handcrafted and Learned CNN Filters". See :cite:`KeyNet2019` for
  more details.
  
  .. image:: _static/img/KeyNet.png
  
  Args:
      pretrained: Download and set pretrained weights to the model.
      keynet_conf: Dict with initialization parameters. Do not pass it, unless you know what you are doing`.
  
  Returns:
      KeyNet response score.
  
  Shape:
      - Input: :math:`(B, 1, H, W)`
      - Output: :math:`(B, 1, H, W)`
code: def __init__(
      self,
      pretrained: bool = False,
      keynet_conf: KeyNet_conf = keynet_default_config,
  ) -> None:
      super().__init__()
  
      num_filters = keynet_conf["num_filters"]
      self.num_levels = keynet_conf["num_levels"]
      kernel_size = keynet_conf["kernel_size"]
      padding = kernel_size // 2
  
      self.feature_extractor = _FeatureExtractor()
      self.last_conv = nn.Sequential(
          nn.Conv2d(
              in_channels=num_filters * self.num_levels,
              out_channels=1,
              kernel_size=kernel_size,
              padding=padding,
          ),
          nn.ReLU(inplace=True),
      )
      # use torch.hub to load pretrained model
      if pretrained:
          pretrained_dict = torch.hub.load_state_dict_from_url(
              KeyNet_URL, map_location=map_location_to_cpu
          )
          self.load_state_dict(
              pretrained_dict["state_dict"], strict=True
          )
      self.eval()
  
imports: from typing import List, Optional
  import torch
  import torch.nn.functional
  from torch import nn
  from typing_extensions import TypedDict
  from kornia.core import Module, Tensor, concatenate
  from kornia.filters import SpatialGradient
  from kornia.geometry.transform import pyrdown
  from kornia.utils.helpers import map_location_to_cpu
  from .scale_space_detector import Detector_config, MultiResolutionDetector, get_default_detector_config
label_desc: Use image node_id 1 to create a new KeyNet object from inherited base classes: Module with example: obj = KeyNet(pretrained, keynet_conf)