Spaces:
Build error
Build error
Sophie98
commited on
Commit
•
f628b78
1
Parent(s):
c63f571
try GAN
Browse files- styleTransfer.py +3 -2
styleTransfer.py
CHANGED
@@ -114,7 +114,7 @@ def StyleTransformer(content_img: Image, style_img: Image):
|
|
114 |
|
115 |
style_transfer_model = hub.load("https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2")
|
116 |
|
117 |
-
def
|
118 |
content_image = tf.convert_to_tensor(content_image, np.float32)[tf.newaxis, ...] / 255.
|
119 |
style_image = tf.convert_to_tensor(style_image, np.float32)[tf.newaxis, ...] / 255.
|
120 |
output = style_transfer_model(content_image, style_image)
|
@@ -125,5 +125,6 @@ def perform_style_transfer(content_image, style_image):
|
|
125 |
|
126 |
|
127 |
def create_styledSofa(sofa:Image, style:Image):
|
128 |
-
styled_sofa =
|
|
|
129 |
return styled_sofa
|
|
|
114 |
|
115 |
style_transfer_model = hub.load("https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2")
|
116 |
|
117 |
+
def StyleGAN(content_image, style_image):
|
118 |
content_image = tf.convert_to_tensor(content_image, np.float32)[tf.newaxis, ...] / 255.
|
119 |
style_image = tf.convert_to_tensor(style_image, np.float32)[tf.newaxis, ...] / 255.
|
120 |
output = style_transfer_model(content_image, style_image)
|
|
|
125 |
|
126 |
|
127 |
def create_styledSofa(sofa:Image, style:Image):
|
128 |
+
styled_sofa = StyleGAN(sofa,style)
|
129 |
+
#styled_sofa = StyleTransformer(sofa,style)
|
130 |
return styled_sofa
|