class_docstr: Network for monocular depth estimation.
      
docstr: Init.
  
  Args:
      path (str, optional): Path to saved model. Defaults to None.
      features (int, optional): Number of features. Defaults to 256.
      backbone (str, optional): Backbone network for encoder. Defaults to resnet50
docstr_tok: ["Init",".","Args",":","path","(","str",",","optional",")",":","Path","to","saved","model",".","Defaults","to","None",".","features","(","int",",","optional",")",":","Number","of","features",".","Defaults","to","256.","backbone","(","str",",","optional",")",":","Backbone","network","for","encoder",".","Defaults","to","resnet50"]
code: def __init__(
      self,
      path=None,
      features=64,
      backbone="efficientnet_lite3",
      non_negative=True,
      exportable=True,
      channels_last=False,
      align_corners=True,
      blocks={"expand": True},
  ):
      """Init.
  
      Args:
          path (str, optional): Path to saved model. Defaults to None.
          features (int, optional): Number of features. Defaults to 256.
          backbone (str, optional): Backbone network for encoder. Defaults to resnet50
      """
      print("Loading weights: ", path)
  
      super(MidasNet_small, self).__init__()
  
      use_pretrained = False if path else True
  
      self.channels_last = channels_last
      self.blocks = blocks
      self.backbone = backbone
  
      self.groups = 1
  
      features1 = features
      features2 = features
      features3 = features
      features4 = features
      self.expand = False
      if "expand" in self.blocks and self.blocks["expand"] == True:
          self.expand = True
          features1 = features
          features2 = features * 2
          features3 = features * 4
          features4 = features * 8
  
      self.pretrained, self.scratch = _make_encoder(
          self.backbone,
          features,
          use_pretrained,
          groups=self.groups,
          expand=self.expand,
          exportable=exportable,
      )
  
      self.scratch.activation = nn.ReLU(False)
  
      self.scratch.refinenet4 = FeatureFusionBlock_custom(
          features4,
          self.scratch.activation,
          deconv=False,
          bn=False,
          expand=self.expand,
          align_corners=align_corners,
      )
      self.scratch.refinenet3 = FeatureFusionBlock_custom(
          features3,
          self.scratch.activation,
          deconv=False,
          bn=False,
          expand=self.expand,
          align_corners=align_corners,
      )
      self.scratch.refinenet2 = FeatureFusionBlock_custom(
          features2,
          self.scratch.activation,
          deconv=False,
          bn=False,
          expand=self.expand,
          align_corners=align_corners,
      )
      self.scratch.refinenet1 = FeatureFusionBlock_custom(
          features1,
          self.scratch.activation,
          deconv=False,
          bn=False,
          align_corners=align_corners,
      )
  
      self.scratch.output_conv = nn.Sequential(
          nn.Conv2d(
              features,
              features // 2,
              kernel_size=3,
              stride=1,
              padding=1,
              groups=self.groups,
          ),
          Interpolate(scale_factor=2, mode="bilinear"),
          nn.Conv2d(
              features // 2, 32, kernel_size=3, stride=1, padding=1
          ),
          self.scratch.activation,
          nn.Conv2d(32, 1, kernel_size=1, stride=1, padding=0),
          nn.ReLU(True) if non_negative else nn.Identity(),
          nn.Identity(),
      )
  
      if path:
          self.load(path)
  
file_path: stablediffusion/ldm/modules/midas/midas/midas_net_custom.py
imports: import torch
  import torch.nn
  from .base_model import BaseModel
  from .blocks import FeatureFusionBlock, FeatureFusionBlock_custom, Interpolate, _make_encoder
label_desc: Use image node_id 1 to create a new MidasNet_small object from inherited base classes: BaseModel with example: obj = MidasNet_small(path, features, backbone, non_negative, exportable, channels_last, align_corners, blocks)