Tunnel_defext / run.sh
Sompote's picture
Upload 392 files
12e6fed verified
#!/bin/bash
# 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