Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
from io import BytesIO
|
| 6 |
|
| 7 |
st.title("Complete image using an AI model trained on Flickr images with the Pix2pix architecture.")
|
| 8 |
image = st.file_uploader("Upload an image", type=["jpg", "png","jpeg"])
|
| 9 |
-
model =
|
| 10 |
|
| 11 |
if image :
|
| 12 |
button = st.button("Complete")
|
| 13 |
image = Image.open(image)
|
| 14 |
image = image.convert("RGB")
|
| 15 |
image = image.resize((128,128-80))
|
| 16 |
-
padded_width = image.width +
|
| 17 |
padded_height =image.height # Keep the original height
|
| 18 |
|
| 19 |
padded_image = Image.new("RGB", (padded_width, padded_height), color="white")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import keras
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
from io import BytesIO
|
| 6 |
|
| 7 |
st.title("Complete image using an AI model trained on Flickr images with the Pix2pix architecture.")
|
| 8 |
image = st.file_uploader("Upload an image", type=["jpg", "png","jpeg"])
|
| 9 |
+
model = keras.models.load_model('/content/drive/MyDrive/complete_.keras')
|
| 10 |
|
| 11 |
if image :
|
| 12 |
button = st.button("Complete")
|
| 13 |
image = Image.open(image)
|
| 14 |
image = image.convert("RGB")
|
| 15 |
image = image.resize((128,128-80))
|
| 16 |
+
padded_width = image.width + 80 # Add the padding width to the original width
|
| 17 |
padded_height =image.height # Keep the original height
|
| 18 |
|
| 19 |
padded_image = Image.new("RGB", (padded_width, padded_height), color="white")
|