Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -36,9 +36,10 @@ class ModelPre(torch.nn.Module):
|
|
36 |
def __init__(self):
|
37 |
super().__init__()
|
38 |
self.embedding = torch.nn.Sequential(
|
39 |
-
*list(models.
|
40 |
torch.nn.Flatten(),
|
41 |
-
torch.nn.Linear(in_features=
|
|
|
42 |
torch.nn.Linear(in_features=512,out_features=len_classes),
|
43 |
)
|
44 |
# Freeze all layers
|
|
|
36 |
def __init__(self):
|
37 |
super().__init__()
|
38 |
self.embedding = torch.nn.Sequential(
|
39 |
+
*list(models.convnext_small(weights=models.ConvNeXt_Small_Weights.IMAGENET1K_V1).children())[:-1],
|
40 |
torch.nn.Flatten(),
|
41 |
+
torch.nn.Linear(in_features=768,out_features=512),
|
42 |
+
torch.nn.ReLU(),
|
43 |
torch.nn.Linear(in_features=512,out_features=len_classes),
|
44 |
)
|
45 |
# Freeze all layers
|