Spaces:
Build error
Build error
Omar Sanseviero
commited on
Commit
·
431240c
1
Parent(s):
e851c5f
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,15 +77,19 @@ model=torch.load("model-final.pth",map_location ='cpu')
|
|
| 77 |
|
| 78 |
import streamlit as st
|
| 79 |
st.title("Image Colorizer")
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
st.image(im)
|
| 90 |
st.text("Colorized!!")
|
| 91 |
-
# st.image(file)
|
|
|
|
| 77 |
|
| 78 |
import streamlit as st
|
| 79 |
st.title("Image Colorizer")
|
| 80 |
+
st.write('\n')
|
| 81 |
+
st.write('Find more info at: https://github.com/Pranav082001/Neural-Image-Colorizer or at https://medium.com/@pranav.kushare2001/colorize-your-black-and-white-photos-using-ai-4652a34e967.')
|
| 82 |
+
|
| 83 |
+
# Sidebar
|
| 84 |
+
st.sidebar.title("Upload Image")
|
| 85 |
+
file=st.sidebar.file_uploader("Please upload a Black and White image",type=["jpg","jpeg","png"])
|
| 86 |
+
|
| 87 |
+
if st.sidebar.button("Colorize image"):
|
| 88 |
+
with st.spinner('Colorizing...'):
|
| 89 |
+
file_bytes = np.asarray(bytearray(file.read()), dtype=np.uint8)
|
| 90 |
+
opencv_image = cv2.imdecode(file_bytes, 1)
|
| 91 |
+
im=colorize(opencv_image)
|
| 92 |
+
st.image(file)
|
| 93 |
+
st.text("Original!!")
|
| 94 |
st.image(im)
|
| 95 |
st.text("Colorized!!")
|
|
|