Spaces:
Runtime error
Runtime error
Gradio2
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import cv2
|
|
8 |
|
9 |
model = from_pretrained_keras('Rietta/CycleGAN_DL', compile=False)
|
10 |
|
11 |
-
imagen = cv2.imread('Kirby.png', cv2.
|
12 |
|
13 |
def transform(img, direction):
|
14 |
img = (img / 127.5) - 1
|
@@ -22,16 +22,11 @@ def transform(img, direction):
|
|
22 |
pred = (pred * 255).astype(np.uint8)
|
23 |
return pred
|
24 |
|
25 |
-
#examples_gta = [[path, 'GTA->REAL'] for path in glob('Examples/gta*')]
|
26 |
-
#examples_real = [[path, 'REAL->GTA'] for path in glob('Examples/real*')]
|
27 |
-
#examples = [*examples_gta, *examples_real]
|
28 |
-
|
29 |
demo = gr.Interface(fn=transform,
|
30 |
inputs=[gr.inputs.Image(shape=(256, 256), type='numpy'),
|
31 |
gr.inputs.Radio(choices=['Sims', 'Warcraft', "Kirby"],
|
32 |
type='index')],
|
33 |
outputs=gr.outputs.Image(type='numpy'))
|
34 |
-
#examples=examples)
|
35 |
|
36 |
if __name__ == '__main__':
|
37 |
demo.launch()
|
|
|
8 |
|
9 |
model = from_pretrained_keras('Rietta/CycleGAN_DL', compile=False)
|
10 |
|
11 |
+
imagen = cv2.imread('Kirby.png', cv2.COLOR_RGB2BGR)
|
12 |
|
13 |
def transform(img, direction):
|
14 |
img = (img / 127.5) - 1
|
|
|
22 |
pred = (pred * 255).astype(np.uint8)
|
23 |
return pred
|
24 |
|
|
|
|
|
|
|
|
|
25 |
demo = gr.Interface(fn=transform,
|
26 |
inputs=[gr.inputs.Image(shape=(256, 256), type='numpy'),
|
27 |
gr.inputs.Radio(choices=['Sims', 'Warcraft', "Kirby"],
|
28 |
type='index')],
|
29 |
outputs=gr.outputs.Image(type='numpy'))
|
|
|
30 |
|
31 |
if __name__ == '__main__':
|
32 |
demo.launch()
|