(self, output_stride, BatchNorm,
pretrained=True)
| 112 | Modified Alighed Xception |
| 113 | """ |
| 114 | def __init__(self, output_stride, BatchNorm, |
| 115 | pretrained=True): |
| 116 | super(xception71, self).__init__() |
| 117 | |
| 118 | self.output_stride = output_stride |
| 119 | if self.output_stride == 16: |
| 120 | middle_block_dilation = 1 |
| 121 | exit_block_dilations = (1, 2) |
| 122 | exit_stride = 2 |
| 123 | elif self.output_stride == 8: |
| 124 | middle_block_dilation = 2 |
| 125 | exit_block_dilations = (2, 4) |
| 126 | exit_stride = 1 |
| 127 | else: |
| 128 | raise NotImplementedError |
| 129 | |
| 130 | # Entry flow |
| 131 | self.conv1 = nn.Conv2d(3, 32, 3, stride=2, padding=1, bias=False) |
| 132 | self.bn1 = BatchNorm(32) |
| 133 | self.relu = nn.ReLU(inplace=True) |
| 134 | |
| 135 | self.conv2 = nn.Conv2d(32, 64, 3, stride=1, padding=1, bias=False) |
| 136 | self.bn2 = BatchNorm(64) |
| 137 | |
| 138 | self.block1 = Block(64, 128, reps=2, stride=2, BatchNorm=BatchNorm, start_with_relu=False) |
| 139 | # stride4 |
| 140 | |
| 141 | self.block2 = Block(128, 256, reps=2, stride=1, BatchNorm=BatchNorm, start_with_relu=False, |
| 142 | grow_first=True) |
| 143 | self.block3 = Block(256, 728, reps=2, stride=2, BatchNorm=BatchNorm, |
| 144 | start_with_relu=True, grow_first=True, is_last=True) |
| 145 | # stride8 |
| 146 | |
| 147 | # Middle flow |
| 148 | self.block4 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 149 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 150 | self.block5 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 151 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 152 | self.block6 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 153 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 154 | self.block7 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 155 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 156 | self.block8 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 157 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 158 | self.block9 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 159 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 160 | self.block10 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 161 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 162 | self.block11 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 163 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 164 | self.block12 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 165 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 166 | self.block13 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 167 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 168 | self.block14 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 169 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
| 170 | self.block15 = Block(728, 728, reps=3, stride=1, dilation=middle_block_dilation, |
| 171 | BatchNorm=BatchNorm, start_with_relu=True, grow_first=True) |
nothing calls this directly
no test coverage detected