| 47 | |
| 48 | |
| 49 | def _make_scratch(in_shape, out_shape, groups=1, expand=False): |
| 50 | scratch = nn.Module() |
| 51 | |
| 52 | out_shape1 = out_shape |
| 53 | out_shape2 = out_shape |
| 54 | out_shape3 = out_shape |
| 55 | out_shape4 = out_shape |
| 56 | if expand==True: |
| 57 | out_shape1 = out_shape |
| 58 | out_shape2 = out_shape*2 |
| 59 | out_shape3 = out_shape*4 |
| 60 | out_shape4 = out_shape*8 |
| 61 | |
| 62 | scratch.layer1_rn = nn.Conv2d( |
| 63 | in_shape[0], out_shape1, kernel_size=3, stride=1, padding=1, bias=False, groups=groups |
| 64 | ) |
| 65 | scratch.layer2_rn = nn.Conv2d( |
| 66 | in_shape[1], out_shape2, kernel_size=3, stride=1, padding=1, bias=False, groups=groups |
| 67 | ) |
| 68 | scratch.layer3_rn = nn.Conv2d( |
| 69 | in_shape[2], out_shape3, kernel_size=3, stride=1, padding=1, bias=False, groups=groups |
| 70 | ) |
| 71 | scratch.layer4_rn = nn.Conv2d( |
| 72 | in_shape[3], out_shape4, kernel_size=3, stride=1, padding=1, bias=False, groups=groups |
| 73 | ) |
| 74 | |
| 75 | return scratch |
| 76 | |
| 77 | |
| 78 | def _make_pretrained_efficientnet_lite3(use_pretrained, exportable=False): |