code: def create_unet_model(
      arch,
      n_out,
      img_size,
      pretrained=True,
      weights=None,
      cut=None,
      n_in=3,
      **kwargs,
  ):
      "Create custom unet architecture"
      meta = model_meta.get(arch, _default_meta)
      if (
          parse(torchvision.__version__) >= parse("0.13")
          and "weights" in meta
      ):
          if weights is not None and not pretrained:
              warn(
                  f"{pretrained=} but `weights` are set {weights=}. To randomly initialize set `pretrained=False` & `weights=None`"
              )
          model = arch(
              weights=meta["weights"]
              if (weights is None and pretrained)
              else weights
          )
      else:
          model = arch(pretrained=pretrained)
      body = create_body(
          model, n_in, pretrained, ifnone(cut, meta["cut"])
      )
      model = models.unet.DynamicUnet(body, n_out, img_size, **kwargs)
      return model
  
imports: from __future__ import annotations
  from packaging.version import parse
  from ..basics import *
  from .core import *
  from .data import *
  from .augment import *
  from .None import models
  import torchvision
  from ..callback.hook import num_features_model
label_desc: Use image node_id 22 for calling a global function with example usage: create_unet_model(arch, n_out, img_size, pretrained, weights, cut, n_in) and returns: model