Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
vgg16.py
CHANGED
@@ -52,7 +52,7 @@ VGG(
|
|
52 |
class VGG_16(nn.Module):
|
53 |
def __init__(self):
|
54 |
super(VGG_16, self).__init__()
|
55 |
-
self.model = models.vgg16(weights=
|
56 |
|
57 |
for i, _ in enumerate(self.model):
|
58 |
if i in [4, 9, 16, 23]:
|
@@ -60,7 +60,6 @@ class VGG_16(nn.Module):
|
|
60 |
|
61 |
def forward(self, x):
|
62 |
features = []
|
63 |
-
|
64 |
for i, layer in enumerate(self.model):
|
65 |
x = layer(x)
|
66 |
if i in [0, 5, 10, 17, 24]:
|
|
|
52 |
class VGG_16(nn.Module):
|
53 |
def __init__(self):
|
54 |
super(VGG_16, self).__init__()
|
55 |
+
self.model = models.vgg16(weights=models.VGG16_Weights).features[:30]
|
56 |
|
57 |
for i, _ in enumerate(self.model):
|
58 |
if i in [4, 9, 16, 23]:
|
|
|
60 |
|
61 |
def forward(self, x):
|
62 |
features = []
|
|
|
63 |
for i, layer in enumerate(self.model):
|
64 |
x = layer(x)
|
65 |
if i in [0, 5, 10, 17, 24]:
|
vgg19.py
CHANGED
@@ -58,7 +58,7 @@ VGG(
|
|
58 |
class VGG_19(nn.Module):
|
59 |
def __init__(self):
|
60 |
super(VGG_19, self).__init__()
|
61 |
-
self.model = models.vgg19(weights=
|
62 |
|
63 |
for i, _ in enumerate(self.model):
|
64 |
if i in [4, 9, 18, 27]:
|
@@ -66,7 +66,6 @@ class VGG_19(nn.Module):
|
|
66 |
|
67 |
def forward(self, x):
|
68 |
features = []
|
69 |
-
|
70 |
for i, layer in enumerate(self.model):
|
71 |
x = layer(x)
|
72 |
if i in [0, 5, 10, 19, 28]:
|
|
|
58 |
class VGG_19(nn.Module):
|
59 |
def __init__(self):
|
60 |
super(VGG_19, self).__init__()
|
61 |
+
self.model = models.vgg19(weights=models.VGG19_Weights).features[:30]
|
62 |
|
63 |
for i, _ in enumerate(self.model):
|
64 |
if i in [4, 9, 18, 27]:
|
|
|
66 |
|
67 |
def forward(self, x):
|
68 |
features = []
|
|
|
69 |
for i, layer in enumerate(self.model):
|
70 |
x = layer(x)
|
71 |
if i in [0, 5, 10, 19, 28]:
|