Spaces:
Runtime error
Runtime error
Commit
·
7f08673
1
Parent(s):
afce970
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,10 +15,9 @@ transform = Compose(
|
|
| 15 |
model = GeneratorUNet.from_pretrained('huggan/pix2pix-edge2shoes')
|
| 16 |
|
| 17 |
def predict_fn(img):
|
| 18 |
-
img = Image.fromarray(img.astype('uint8'), 'RGB')
|
| 19 |
inp = transform(img).unsqueeze(0)
|
| 20 |
out = model(inp)
|
| 21 |
save_image(out, 'out.png', normalize=True)
|
| 22 |
return 'out.png'
|
| 23 |
|
| 24 |
-
gr.Interface(predict_fn, inputs=
|
|
|
|
| 15 |
model = GeneratorUNet.from_pretrained('huggan/pix2pix-edge2shoes')
|
| 16 |
|
| 17 |
def predict_fn(img):
|
|
|
|
| 18 |
inp = transform(img).unsqueeze(0)
|
| 19 |
out = model(inp)
|
| 20 |
save_image(out, 'out.png', normalize=True)
|
| 21 |
return 'out.png'
|
| 22 |
|
| 23 |
+
gr.Interface(predict_fn, inputs=gr.inputs.Image(type='pil'), outputs='image', examples=[['sample.jpg']]).launch()
|