Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import numpy as np
|
|
| 3 |
from tensorflow.keras.preprocessing.image import load_img, img_to_array
|
| 4 |
from tensorflow.keras.models import load_model
|
| 5 |
from PIL import Image
|
|
|
|
| 6 |
|
| 7 |
inputs = gr.inputs.Image(shape=(512, 512))
|
| 8 |
o1 = gr.outputs.Image()
|
|
@@ -16,12 +17,12 @@ def colorify(pixels):
|
|
| 16 |
gen_image = gen_model.predict(pixels)
|
| 17 |
gen_image = (gen_image + 1) / 1.5
|
| 18 |
|
| 19 |
-
return gen_image[0]
|
| 20 |
|
| 21 |
title = "Colorify"
|
| 22 |
description = "Recolor your images using this lite version of PIX2PIX GAN"
|
| 23 |
examples=[['example1.png'],['example2.jpg']]
|
| 24 |
article = "<p style='text-align: center'>"
|
| 25 |
|
| 26 |
-
gr.Interface(fn=colorify, inputs=inputs, outputs=
|
| 27 |
|
|
|
|
| 3 |
from tensorflow.keras.preprocessing.image import load_img, img_to_array
|
| 4 |
from tensorflow.keras.models import load_model
|
| 5 |
from PIL import Image
|
| 6 |
+
import matplotlib.pyplot as plt
|
| 7 |
|
| 8 |
inputs = gr.inputs.Image(shape=(512, 512))
|
| 9 |
o1 = gr.outputs.Image()
|
|
|
|
| 17 |
gen_image = gen_model.predict(pixels)
|
| 18 |
gen_image = (gen_image + 1) / 1.5
|
| 19 |
|
| 20 |
+
return plt.imshow(gen_image[0])
|
| 21 |
|
| 22 |
title = "Colorify"
|
| 23 |
description = "Recolor your images using this lite version of PIX2PIX GAN"
|
| 24 |
examples=[['example1.png'],['example2.jpg']]
|
| 25 |
article = "<p style='text-align: center'>"
|
| 26 |
|
| 27 |
+
gr.Interface(fn=colorify, inputs=inputs, outputs=o1, title=title, description=description, article=article, examples=examples, enable_queue=True).launch()
|
| 28 |
|