File size: 575 Bytes
e46c179
b2f70fb
e46c179
b2f70fb
 
 
 
 
 
e46c179
b2f70fb
 
50ff99e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import torch.nn as nn
from torchvision.models import mobilenet_v2, MobileNet_V2_Weights

class MobileNetV2Backbone(nn.Module):
    def __init__(self):
        super(MobileNetV2Backbone, self).__init__()
        # Используем актуальный способ загрузки предобученной модели
        self.model = mobilenet_v2(weights=MobileNet_V2_Weights.DEFAULT).features
        self.enc_channels = [24, 32, 96, 320]  # Каналы с разных уровней feature extractor

    def forward(self, x):
        return self.model(x)