| import streamlit as st | |
| from backend import load_random_object, capture_views # Import the backend functions | |
| # Title and instructions | |
| st.title("3D Object Viewer") | |
| st.write("Click the button below to view a random object's front, top, bottom, and side views.") | |
| # Button to generate views | |
| if st.button("Generate Views"): | |
| st.write("Loading a random object...") | |
| obj = load_random_object() | |
| st.write("Generating views...") | |
| views = capture_views(obj) | |
| # Display views | |
| for view_name, img in views.items(): | |
| st.subheader(f"{view_name.capitalize()} View") | |
| st.image(img) | |