mallelapreethi commited on
Commit
b773117
·
verified ·
1 Parent(s): a15455d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -13
app.py CHANGED
@@ -15,13 +15,46 @@ 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
  # Title and description
19
- st.title("🎨 Image to Sketch Converter")
20
  st.markdown("""
21
  Convert your images into beautiful sketches with this simple app.
22
  Upload an image, and get the sketch version instantly!
23
  """)
24
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  # Sidebar for user input
26
  st.sidebar.header("Upload Your Image")
27
  uploaded_file = st.sidebar.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
@@ -53,18 +86,7 @@ else:
53
 
54
  # Footer
55
  st.markdown("""
56
- <style>
57
- .footer {
58
- position: fixed;
59
- left: 0;
60
- bottom: 0;
61
- width: 100%;
62
- background-color: #f1f1f1;
63
- text-align: center;
64
- padding: 10px;
65
- }
66
- </style>
67
  <div class="footer">
68
- Made with ❤️ by [Your Name](https://yourwebsite.com)
69
  </div>
70
  """, unsafe_allow_html=True)
 
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 {
22
+ color: #FFA500;
23
+ font-size: 2.5em;
24
+ font-weight: bold;
25
+ text-align: center;
26
+ }
27
+ .footer {
28
+ position: fixed;
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)
38
+
39
  # Title and description
40
+ st.markdown('<p class="title">🎨 Image to Sketch Converter</p>', unsafe_allow_html=True)
41
  st.markdown("""
42
  Convert your images into beautiful sketches with this simple app.
43
  Upload an image, and get the sketch version instantly!
44
  """)
45
 
46
+ # Example conversions
47
+ st.subheader("Example Conversions")
48
+ col1, col2 = st.columns(2)
49
+
50
+ example_image = cv2.imread('example.jpg') # Replace with the path to an example image
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
  # Sidebar for user input
59
  st.sidebar.header("Upload Your Image")
60
  uploaded_file = st.sidebar.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
 
86
 
87
  # Footer
88
  st.markdown("""
 
 
 
 
 
 
 
 
 
 
 
89
  <div class="footer">
90
+ Made with ❤️ by MallelaPreethi
91
  </div>
92
  """, unsafe_allow_html=True)