Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def image_to_sketch(image):
|
|
15 |
# Streamlit app layout
|
16 |
st.set_page_config(page_title="Image to Sketch Converter", page_icon="🎨", layout="centered")
|
17 |
|
18 |
-
# Custom CSS for heading color
|
19 |
st.markdown("""
|
20 |
<style>
|
21 |
.title {
|
@@ -25,13 +25,16 @@ st.markdown("""
|
|
25 |
text-align: center;
|
26 |
}
|
27 |
.footer {
|
28 |
-
position:
|
29 |
-
left: 0;
|
30 |
bottom: 0;
|
31 |
width: 100%;
|
32 |
background-color: #f1f1f1;
|
33 |
text-align: center;
|
34 |
padding: 10px;
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
</style>
|
37 |
""", unsafe_allow_html=True)
|
@@ -47,15 +50,18 @@ st.markdown("""
|
|
47 |
st.subheader("Example Conversions")
|
48 |
col1, col2 = st.columns(2)
|
49 |
|
50 |
-
|
|
|
51 |
example_sketch = image_to_sketch(example_image)
|
52 |
|
53 |
with col1:
|
54 |
st.image(example_image, caption='Original Image', use_column_width=True)
|
55 |
with col2:
|
56 |
st.image(example_sketch, caption='Sketch Image', use_column_width=True)
|
57 |
-
|
58 |
-
|
|
|
|
|
59 |
# Sidebar for user input
|
60 |
st.sidebar.header("Upload Your Image")
|
61 |
uploaded_file = st.sidebar.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
@@ -85,6 +91,8 @@ if uploaded_file is not None:
|
|
85 |
else:
|
86 |
st.sidebar.info("Please upload an image to convert.")
|
87 |
|
|
|
|
|
88 |
# Footer
|
89 |
st.markdown("""
|
90 |
<div class="footer">
|
|
|
15 |
# Streamlit app layout
|
16 |
st.set_page_config(page_title="Image to Sketch Converter", page_icon="🎨", layout="centered")
|
17 |
|
18 |
+
# Custom CSS for heading color and footer positioning
|
19 |
st.markdown("""
|
20 |
<style>
|
21 |
.title {
|
|
|
25 |
text-align: center;
|
26 |
}
|
27 |
.footer {
|
28 |
+
position: relative;
|
|
|
29 |
bottom: 0;
|
30 |
width: 100%;
|
31 |
background-color: #f1f1f1;
|
32 |
text-align: center;
|
33 |
padding: 10px;
|
34 |
+
margin-top: 50px;
|
35 |
+
}
|
36 |
+
.content {
|
37 |
+
margin-bottom: 70px;
|
38 |
}
|
39 |
</style>
|
40 |
""", unsafe_allow_html=True)
|
|
|
50 |
st.subheader("Example Conversions")
|
51 |
col1, col2 = st.columns(2)
|
52 |
|
53 |
+
# Replace 'Dog.jpg' with the path to an example image if running locally
|
54 |
+
example_image = cv2.imread('Dog.jpg')
|
55 |
example_sketch = image_to_sketch(example_image)
|
56 |
|
57 |
with col1:
|
58 |
st.image(example_image, caption='Original Image', use_column_width=True)
|
59 |
with col2:
|
60 |
st.image(example_sketch, caption='Sketch Image', use_column_width=True)
|
61 |
+
|
62 |
+
# Main content with padding at the bottom to prevent overlap with footer
|
63 |
+
st.markdown('<div class="content">', unsafe_allow_html=True)
|
64 |
+
|
65 |
# Sidebar for user input
|
66 |
st.sidebar.header("Upload Your Image")
|
67 |
uploaded_file = st.sidebar.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
|
|
91 |
else:
|
92 |
st.sidebar.info("Please upload an image to convert.")
|
93 |
|
94 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
95 |
+
|
96 |
# Footer
|
97 |
st.markdown("""
|
98 |
<div class="footer">
|