mallelapreethi commited on
Commit
6c7dde0
·
verified ·
1 Parent(s): e481a24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -50,13 +50,20 @@ st.markdown("""
50
  col1, col2 = st.columns(2)
51
 
52
  # Replace 'Dog.jpg' with the path to an example image if running locally
53
- example_image = cv2.imread('Dog.jpg')
54
- example_sketch = image_to_sketch(example_image)
55
 
56
- with col1:
57
- st.subheader("Example Conversions")
58
- st.image(example_image, caption='Original Image', use_column_width=True)
59
- st.image(example_sketch, caption='Sketch Image', use_column_width=True)
 
 
 
 
 
 
 
60
 
61
  with col2:
62
  st.subheader("Upload Your Image")
 
50
  col1, col2 = st.columns(2)
51
 
52
  # Replace 'Dog.jpg' with the path to an example image if running locally
53
+ example_image_path = 'Dog.jpg'
54
+ example_image = cv2.imread(example_image_path)
55
 
56
+ if example_image is not None:
57
+ # Convert BGR to RGB for correct color display
58
+ example_image_rgb = cv2.cvtColor(example_image, cv2.COLOR_BGR2RGB)
59
+ example_sketch = image_to_sketch(example_image)
60
+
61
+ with col1:
62
+ st.subheader("Example Conversions")
63
+ st.image(example_image_rgb, caption='Original Image', use_column_width=True)
64
+ st.image(example_sketch, caption='Sketch Image', use_column_width=True)
65
+ else:
66
+ st.error(f"Failed to load example image from path: {example_image_path}")
67
 
68
  with col2:
69
  st.subheader("Upload Your Image")