class_docstr: Architecture based on U-Net: Convolutional Networks for Biomedical Image Segmentation.
  
  Link - https://arxiv.org/abs/1505.04597
  
  >>> UNet(num_classes=2, num_layers=3)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  UNet(
    (layers): ModuleList(
      (0): DoubleConv(...)
      (1): Down(...)
      (2): Down(...)
      (3): Up(...)
      (4): Up(...)
      (5): Conv2d(64, 2, kernel_size=(1, 1), stride=(1, 1))
    )
  )
class_docstr_tok: ["Architecture","based","on","U-Net",":","Convolutional","Networks","for","Biomedical","Image","Segmentation",".","Link","-","https",":","\/\/arxiv.org\/abs\/1505.04597",">",">",">","UNet","(","num_classes=2",",","num_layers=3",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","UNet","(","(","layers",")",":","ModuleList","(","(","0",")",":","DoubleConv","(","...",")","(","1",")",":","Down","(","...",")","(","2",")",":","Down","(","...",")","(","3",")",":","Up","(","...",")","(","4",")",":","Up","(","...",")","(","5",")",":","Conv2d","(","64",",","2",",","kernel_size=","(","1",",","1",")",",","stride=","(","1",",","1",")",")",")",")"]
docstr: Args:
      num_classes: Number of output classes required (default 19 for KITTI dataset)
      num_layers: Number of layers in each side of U-net
      features_start: Number of features in first layer
      bilinear: Whether to use bilinear interpolation or transposed convolutions for upsampling.
docstr_tok: ["Args",":","num_classes",":","Number","of","output","classes","required","(","default","19","for","KITTI","dataset",")","num_layers",":","Number","of","layers","in","each","side","of","U-net","features_start",":","Number","of","features","in","first","layer","bilinear",":","Whether","to","use","bilinear","interpolation","or","transposed","convolutions","for","upsampling","."]
code: def __init__(
      self,
      num_classes: int = 19,
      num_layers: int = 5,
      features_start: int = 64,
      bilinear: bool = False,
  ):
      """
      Args:
          num_classes: Number of output classes required (default 19 for KITTI dataset)
          num_layers: Number of layers in each side of U-net
          features_start: Number of features in first layer
          bilinear: Whether to use bilinear interpolation or transposed convolutions for upsampling.
      """
      super().__init__()
      self.num_layers = num_layers
  
      layers = [DoubleConv(3, features_start)]
  
      feats = features_start
      for _ in range(num_layers - 1):
          layers.append(Down(feats, feats * 2))
          feats *= 2
  
      for _ in range(num_layers - 1):
          layers.append(Up(feats, feats // 2, bilinear))
          feats //= 2
  
      layers.append(nn.Conv2d(feats, num_classes, kernel_size=1))
  
      self.layers = nn.ModuleList(layers)
  
imports: import os
  import random
  from argparse import ArgumentParser, Namespace
  import numpy
  import torch
  import torch.nn.functional
  import torchvision.transforms
  from lightning.pytorch import LightningModule, Trainer, cli_lightning_logo
  from PIL import Image
  from torch import nn
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 1 to create a new UNet object from inherited base classes: nn with example: obj = UNet(num_classes, num_layers, features_start, bilinear)