Essa20001 commited on
Commit
99eba51
·
verified ·
1 Parent(s): 97b893c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,19 +1,19 @@
1
  import streamlit as st
2
- import tensorflow as tf
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 = tf.keras.models.load_model('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 + padding_width # 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")
 
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")