MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / __init__

Method __init__

lib/network_auxi.py:72–93  ·  view source on GitHub ↗
(self,
                 backbone='resnet',
                 depth=50,
                 upfactors=[2, 2, 2, 2])

Source from the content-addressed store, hash-verified

70 152: Resnet.resnet152
71 }
72 def __init__(self,
73 backbone='resnet',
74 depth=50,
75 upfactors=[2, 2, 2, 2]):
76 super(DepthNet, self).__init__()
77 self.backbone = backbone
78 self.depth = depth
79 self.pretrained = False
80 self.inchannels = [256, 512, 1024, 2048]
81 self.midchannels = [256, 256, 256, 512]
82 self.upfactors = upfactors
83 self.outchannels = 1
84
85 # Build model
86 if self.backbone == 'resnet':
87 if self.depth not in DepthNet.__factory:
88 raise KeyError("Unsupported depth:", self.depth)
89 self.encoder = DepthNet.__factory[depth](pretrained=self.pretrained)
90 elif self.backbone == 'resnext101_32x8d':
91 self.encoder = Resnext_torch.resnext101_32x8d(pretrained=self.pretrained)
92 else:
93 self.encoder = Resnext_torch.resnext101(pretrained=self.pretrained)
94
95 def forward(self, x):
96 x = self.encoder(x) # 1/32, 1/16, 1/8, 1/4

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected