Spaces:
Running
Running
Update network.py
Browse files- network.py +2 -2
network.py
CHANGED
@@ -104,7 +104,7 @@ class Style_Transfer_Network(nn.Module):
|
|
104 |
# encode style images
|
105 |
style_features = []
|
106 |
for style in styles:
|
107 |
-
if preserve_color == '
|
108 |
style = batch_wct(style, content)
|
109 |
style_features.append(self.encoder(style))
|
110 |
|
@@ -117,7 +117,7 @@ class Style_Transfer_Network(nn.Module):
|
|
117 |
transformed_feature = sum(transformed_features)
|
118 |
|
119 |
stylized_image = self.decoder(transformed_feature)
|
120 |
-
if preserve_color == "
|
121 |
stylized_image = batch_wct(stylized_image, content)
|
122 |
if preserve_color == "histogram_matching":
|
123 |
stylized_image = batch_histogram_matching(stylized_image, content)
|
|
|
104 |
# encode style images
|
105 |
style_features = []
|
106 |
for style in styles:
|
107 |
+
if preserve_color == 'whitening_and_coloring' or preserve_color == 'histogram_matching':
|
108 |
style = batch_wct(style, content)
|
109 |
style_features.append(self.encoder(style))
|
110 |
|
|
|
117 |
transformed_feature = sum(transformed_features)
|
118 |
|
119 |
stylized_image = self.decoder(transformed_feature)
|
120 |
+
if preserve_color == "whitening_and_coloring":
|
121 |
stylized_image = batch_wct(stylized_image, content)
|
122 |
if preserve_color == "histogram_matching":
|
123 |
stylized_image = batch_histogram_matching(stylized_image, content)
|