Legola commited on
Commit
dc320c8
·
1 Parent(s): bfe072b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -16,7 +16,13 @@ from PIL import Image
16
  import numpy as np
17
  from model import ContentLoss, gram_matrix, StyleLoss, image_transform, get_input_optimizer,get_style_model_and_losses
18
 
 
 
19
 
 
 
 
 
20
 
21
 
22
 
@@ -125,8 +131,8 @@ example_list = [["examples/" + example] for example in os.listdir("examples")]
125
  demo = gr.Interface(
126
  fn=style_transfer,
127
  inputs=[
128
- gr.inputs.Image(label="content Image",type='pil'),
129
- gr.inputs.Image(label="style_image",type='pil')
130
  ],
131
  examples=example_list,
132
  outputs="image",
 
16
  import numpy as np
17
  from model import ContentLoss, gram_matrix, StyleLoss, image_transform, get_input_optimizer,get_style_model_and_losses
18
 
19
+ #Defining the Model
20
+ cnn = models.vgg19(pretrained=True).features.eval()
21
 
22
+ #Normalization
23
+
24
+ cnn_normalization_mean = torch.tensor([0.485, 0.456, 0.406])
25
+ cnn_normalization_std = torch.tensor([0.229, 0.224, 0.225])
26
 
27
 
28
 
 
131
  demo = gr.Interface(
132
  fn=style_transfer,
133
  inputs=[
134
+ gr.inputs.Image(label="content Image"),
135
+ gr.inputs.Image(label="style_image")
136
  ],
137
  examples=example_list,
138
  outputs="image",