transform2
Browse files
app.py
CHANGED
@@ -14,6 +14,14 @@ transform = Compose(
|
|
14 |
]
|
15 |
)
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
generator = GeneratorUNet.from_pretrained("debisoft/stamen-wc-gan")
|
18 |
|
19 |
def greet(input):
|
@@ -22,7 +30,7 @@ def greet(input):
|
|
22 |
pixel_values = transform(image).unsqueeze(0)
|
23 |
output = generator(pixel_values)
|
24 |
|
25 |
-
return
|
26 |
|
27 |
iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="coord_zxy", value="/18/73237/95677")], outputs=[gr.Image(type="pil", width=256, label="Output Image")])
|
28 |
|
|
|
14 |
]
|
15 |
)
|
16 |
|
17 |
+
transform2 = Compose(
|
18 |
+
[
|
19 |
+
#Resize((256, 256), Image.BICUBIC),
|
20 |
+
ToPILImage(),
|
21 |
+
#Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
|
22 |
+
]
|
23 |
+
)
|
24 |
+
|
25 |
generator = GeneratorUNet.from_pretrained("debisoft/stamen-wc-gan")
|
26 |
|
27 |
def greet(input):
|
|
|
30 |
pixel_values = transform(image).unsqueeze(0)
|
31 |
output = generator(pixel_values)
|
32 |
|
33 |
+
return transform2(output)
|
34 |
|
35 |
iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="coord_zxy", value="/18/73237/95677")], outputs=[gr.Image(type="pil", width=256, label="Output Image")])
|
36 |
|