Update model.py
Browse files
model.py
CHANGED
@@ -4,6 +4,7 @@ import torch.nn as nn
|
|
4 |
import torchvision.models as models
|
5 |
from PIL import Image
|
6 |
from vgg_weights import VGG19_Weights
|
|
|
7 |
|
8 |
|
9 |
#Content Loss
|
@@ -88,9 +89,12 @@ def image_transform(image):
|
|
88 |
model = torchvision.models.efficientnet_b2(weights=weights)
|
89 |
|
90 |
#Defining a model
|
91 |
-
weights=weights=VGG19_Weights.IMAGENET1K_V1
|
92 |
-
cnn = models.vgg19(weights=weights).features.eval()
|
|
|
|
|
93 |
|
|
|
94 |
#getting the input optimizer
|
95 |
def get_input_optimizer(input_img):
|
96 |
# this line to show that input is a parameter that requires a gradient
|
|
|
4 |
import torchvision.models as models
|
5 |
from PIL import Image
|
6 |
from vgg_weights import VGG19_Weights
|
7 |
+
wget https://github.com/cryu854/FastNeuralStyleTransfer/raw/master/models/vgg19-d01eb7cb.pth -P models/
|
8 |
|
9 |
|
10 |
#Content Loss
|
|
|
89 |
model = torchvision.models.efficientnet_b2(weights=weights)
|
90 |
|
91 |
#Defining a model
|
92 |
+
# weights=weights=torchvision.models.VGG19_Weights.IMAGENET1K_V1
|
93 |
+
# cnn = models.vgg19(weights=weights).features.eval()
|
94 |
+
weights = models.vgg19(pretrained='imagenet')
|
95 |
+
cnn = weights.features.eval()
|
96 |
|
97 |
+
|
98 |
#getting the input optimizer
|
99 |
def get_input_optimizer(input_img):
|
100 |
# this line to show that input is a parameter that requires a gradient
|