netzhang's picture
Deploy merged demo: representative images (#42), t-SNE exact solver (#45), PCA reproducibility (#46), decoupled projection/KMeans + thread pipeline, demo header/footer
269ea1f verified
Raw
History Blame Contribute Delete
1.57 kB
"""
BYO Images Embed & Explore application.
This application allows users to bring their own images, generate embeddings,
cluster them, and explore the results visually.
"""
import streamlit as st
def main():
"""CLI entry point β€” launches the Streamlit server."""
import sys
import os
from streamlit.web import cli as stcli
sys.argv = ["streamlit", "run", os.path.abspath(__file__), "--server.headless", "true"]
stcli.main()
def app():
"""Streamlit application layout."""
from apps.embed_explore.components.sidebar import render_clustering_sidebar
from apps.embed_explore.components.image_preview import render_image_preview
from shared.components.summary import render_clustering_summary
from shared.components.visualization import render_scatter_plot
st.set_page_config(
layout="wide",
page_title="Embed & Explore",
page_icon="πŸ”"
)
st.title("πŸ” Embed & Explore")
st.markdown("Generate embeddings from your images, cluster them, and explore the results.")
# Create the main layout
col_settings, col_plot, col_preview = st.columns([2, 6, 3])
with col_settings:
# Render the sidebar with all controls
render_clustering_sidebar()
with col_plot:
# Render the main scatter plot
render_scatter_plot()
with col_preview:
# Render the image preview
render_image_preview()
# Bottom section: Clustering summary
st.markdown("---")
render_clustering_summary()
if __name__ == "__main__":
app()