debisoft commited on
Commit
399a541
·
1 Parent(s): cf87232

transform2

Browse files
Files changed (1) hide show
  1. app.py +9 -1
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 ToPILImage(output)
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