-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
104 lines (92 loc) · 3.37 KB
/
setup.sh
File metadata and controls
104 lines (92 loc) · 3.37 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Setup script for AI Interview Intelligence System
set -e # Exit on error
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ AI Interview Intelligence System - Setup Script ║"
echo "╚═══════════════════════════════════════════════════════════╝"
echo ""
# Check Python version
echo "1️⃣ Checking Python version..."
python_version=$(python3 --version 2>&1 | awk '{print $2}')
echo " Python version: $python_version"
if ! python3 -c 'import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)'; then
echo " ❌ Python 3.8+ required. Please upgrade Python."
exit 1
fi
echo " ✅ Python version OK"
echo ""
# Check FFmpeg
echo "2️⃣ Checking FFmpeg..."
if ! command -v ffmpeg &> /dev/null; then
echo " ⚠️ FFmpeg not found. Please install:"
echo " Ubuntu/Debian: sudo apt-get install ffmpeg"
echo " macOS: brew install ffmpeg"
echo " Windows: Download from https://ffmpeg.org/download.html"
read -p " Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
else
echo " ✅ FFmpeg installed"
fi
echo ""
# Create virtual environment
echo "3️⃣ Creating virtual environment..."
if [ -d "venv" ]; then
echo " ⚠️ Virtual environment already exists"
read -p " Recreate? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf venv
python3 -m venv venv
echo " ✅ Virtual environment recreated"
fi
else
python3 -m venv venv
echo " ✅ Virtual environment created"
fi
echo ""
# Activate virtual environment
echo "4️⃣ Activating virtual environment..."
source venv/bin/activate
echo " ✅ Virtual environment activated"
echo ""
# Upgrade pip
echo "5️⃣ Upgrading pip..."
pip install --upgrade pip --quiet
echo " ✅ pip upgraded"
echo ""
# Install dependencies
echo "6️⃣ Installing dependencies (this may take a few minutes)..."
pip install -r requirements.txt --quiet
if [ $? -eq 0 ]; then
echo " ✅ All dependencies installed"
else
echo " ❌ Some dependencies failed to install"
echo " Try running: pip install -r requirements.txt"
fi
echo ""
# Create necessary directories
echo "7️⃣ Creating directories..."
mkdir -p data/sample_videos
mkdir -p data/models_cache
mkdir -p outputs
mkdir -p models
echo " ✅ Directories created"
echo ""
# Run system check
echo "8️⃣ Running system check..."
python demo.py
echo ""
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ ✅ Setup Complete! ║"
echo "╚═══════════════════════════════════════════════════════════╝"
echo ""
echo "Next steps:"
echo " 1. Activate virtual environment: source venv/bin/activate"
echo " 2. Launch web app: streamlit run app.py"
echo " 3. Or run demo: python demo.py"
echo ""
echo "For help, see README.md and docs/"
echo ""