interior room decor- Upload an empty room image and add furniture to decor and furnish it
To upload files, please first save the app
import streamlit as st
from PIL import Image
import numpy as np
import io
st.title("Interior Room Decorator")
st.write("""
Upload an empty room image and customize it with furniture and decor items.
Choose from the available furniture items to decorate your room!
""")
# Upload empty room image
uploaded_file = st.file_uploader("Upload an empty room image", type=['png', 'jpg', 'jpeg'])
if uploaded_file is not None:
# Display original image
image = Image.open(uploaded_file)
st.image(image, caption='Original Room', use_column_width=True)
# Create a container for the furniture options
with st.container():
st.subheader("Add Furniture")
col1, col2 = st.columns(2)
with col1:
# Furniture selection
furniture_type = st.selectbox(
"Select Furniture Type",
["Sofa", "Chair", "Table", "Bed", "Lamp", "Bookshelf"]
)
# Color selection
furniture_color = st.color_picker("Select Furniture Color", "#000000")
# Size selection
size = st.slider("Furniture Size", 0.5, 2.0, 1.0)
with col2:
# Position selection
st.write("Position (click on preview to place furniture)")
x_pos = st.slider("X Position", 0, image.width, image.width // 2)
y_pos = st.slider("Y Position", 0, image.height, image.height // 2)
if st.button("Add Furniture"):
st.write(f"Adding {furniture_type} at position ({x_pos}, {y_pos}) with color {furniture_color} and size {size}")
# Here you would normally add the furniture to the image
# For this demo, we'll just show a message
st.success(f"{furniture_type} has been added to the room!")
# Save/Export options
if st.button("Export Decorated Room"):
st.write("In a full implementation, this would save the decorated room image.")
st.info("This is a demo version. In a complete version, the app would actually render furniture on the image.")
else:
st.info("Please upload an image to start decorating your room!")
# Add some helpful tips
with st.expander("Tips for best results"):
st.write("""
1. Use high-resolution room images for better results
2. Make sure the room image has good lighting
3. Try to upload images with a clear perspective
4. Experiment with different furniture sizes and positions
""")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?