import streamlit as st import app_qwen import project.app_florence as app_florence import project.app_combined as app_combined # Set page configuration st.set_page_config( page_title="Vehicle Analysis Suite", page_icon="🚗", layout="wide", initial_sidebar_state="expanded" # Show sidebar by default ) # Custom CSS for the sidebar and main content st.markdown(""" """, unsafe_allow_html=True) def main(): # Sidebar for app selection with st.sidebar: st.markdown("### 🚗 Vehicle Analysis Suite") st.markdown("---") app_mode = st.radio( "Select Analysis Mode:", ["Qwen2-VL Classifier", "Florence-2 Detector", "Combined Pipeline"], index=0, # Default to Qwen2-VL key="app_selection" ) st.markdown("---") st.markdown(""" ### About the Models: **Qwen2-VL Classifier** - Quick vehicle classification - Single-word output - Optimized for vehicle types **Florence-2 Detector** - Visual object detection - Bounding box visualization - Detailed spatial analysis **Combined Pipeline** - Two-stage analysis - Classification + Detection - Comprehensive results """) # Clear previous app states when switching if 'last_app' not in st.session_state: st.session_state.last_app = None if st.session_state.last_app != app_mode: # Clear relevant session state variables for key in list(st.session_state.keys()): if key not in ['app_selection', 'last_app']: del st.session_state[key] st.session_state.last_app = app_mode # Main content area if app_mode == "Qwen2-VL Classifier": st.markdown("""
Specialized in quick and accurate vehicle type classification
Advanced visual detection with bounding box visualization
Comprehensive vehicle analysis using both models