Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -35,12 +35,12 @@ class ModelPre(torch.nn.Module):
|
|
35 |
def __init__(self):
|
36 |
super().__init__()
|
37 |
self.embedding = torch.nn.Sequential(
|
38 |
-
*list(models.
|
39 |
torch.nn.Flatten(),
|
40 |
-
torch.nn.Linear(in_features=
|
41 |
-
torch.nn.
|
42 |
-
torch.nn.Linear(in_features=512, out_features=len(le.classes_) + 1),
|
43 |
)
|
|
|
44 |
|
45 |
def forward(self, data):
|
46 |
return self.embedding(data)
|
|
|
35 |
def __init__(self):
|
36 |
super().__init__()
|
37 |
self.embedding = torch.nn.Sequential(
|
38 |
+
*list(models.efficientnet_v2_m(weights=models.EfficientNet_V2_M_Weights.IMAGENET1K_V1).children())[:-1],
|
39 |
torch.nn.Flatten(),
|
40 |
+
torch.nn.Linear(in_features=1280,out_features=512),
|
41 |
+
torch.nn.Linear(in_features=512,out_features=len_classes),
|
|
|
42 |
)
|
43 |
+
# Freeze all layers
|
44 |
|
45 |
def forward(self, data):
|
46 |
return self.embedding(data)
|