Spaces:
Sleeping
Sleeping
File size: 1,337 Bytes
12e6fed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#!/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
|