Spaces:
Sleeping
Sleeping
| # Tunnel Crack Detection App Launcher | |
| echo "π Starting Tunnel Crack Detection App..." | |
| # Check if virtual environment exists | |
| if [ -d "venv" ]; then | |
| echo "π¦ Activating virtual environment..." | |
| source venv/bin/activate | |
| else | |
| echo "β οΈ Virtual environment not found. Consider creating one:" | |
| echo " python -m venv venv" | |
| echo " source venv/bin/activate" | |
| echo " pip install -r requirements.txt" | |
| echo "" | |
| fi | |
| # Check if default model exists | |
| DEFAULT_MODEL="/Users/sompoteyouwai/env/model_weight/segment_defect.pt" | |
| if [ -f "$DEFAULT_MODEL" ]; then | |
| echo "β Default model found: $DEFAULT_MODEL" | |
| else | |
| echo "β οΈ Default model not found at: $DEFAULT_MODEL" | |
| echo " You can still upload a custom model through the web interface" | |
| fi | |
| # Check if requirements are installed | |
| echo "π§ Checking dependencies..." | |
| python -c "import streamlit, torch, ultralytics" 2>/dev/null | |
| if [ $? -eq 0 ]; then | |
| echo "β Dependencies verified" | |
| else | |
| echo "β Missing dependencies. Installing..." | |
| pip install -r requirements.txt | |
| fi | |
| echo "" | |
| echo "π Launching Streamlit app..." | |
| echo "π± Open your browser to: http://localhost:8501" | |
| echo "βΉοΈ Press Ctrl+C to stop the server" | |
| echo "" | |
| # Launch Streamlit | |
| streamlit run streamlit_app.py --server.port 8501 --server.address localhost | |