-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·106 lines (93 loc) · 3.15 KB
/
install.sh
File metadata and controls
executable file
·106 lines (93 loc) · 3.15 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
105
106
#!/bin/bash
# Installation script for Tello Vision
set -e
echo "========================================="
echo "Tello Vision Installation"
echo "========================================="
echo ""
# Check Python version
python_version=$(python3 --version 2>&1 | awk '{print $2}')
required_version="3.10"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "Error: Python 3.10 or higher is required"
echo "Current version: $python_version"
exit 1
fi
echo "✓ Python version OK: $python_version"
echo ""
# Create virtual environment
echo "[1/4] Creating virtual environment..."
python3 -m venv venv
source venv/bin/activate
echo "✓ Virtual environment created"
echo ""
# Upgrade pip
echo "[2/4] Upgrading pip..."
pip install --upgrade pip wheel setuptools
echo "✓ pip upgraded"
echo ""
# Prompt for detector backend
echo "[3/4] Select detector backend:"
echo " 1) YOLOv8 (recommended - fast, real-time)"
echo " 2) Detectron2 (slower but more accurate)"
echo " 3) Both (requires more disk space)"
read -p "Enter choice [1-3]: " backend_choice
case $backend_choice in
1)
echo "Installing with YOLOv8..."
pip install -e ".[yolo]"
;;
2)
echo "Installing with Detectron2..."
# Install base dependencies first (includes torch)
pip install -e .
# Then install detectron2 (needs torch to build)
pip install "git+https://github.com/facebookresearch/detectron2.git"
;;
3)
echo "Installing with both backends..."
# Install base + yolo first (includes torch)
pip install -e ".[yolo]"
# Then install detectron2 (needs torch to build)
echo "Installing Detectron2 (requires torch, installed above)..."
pip install "git+https://github.com/facebookresearch/detectron2.git"
;;
*)
echo "Invalid choice. Installing YOLOv8 by default..."
pip install -e ".[yolo]"
;;
esac
echo "✓ Dependencies installed"
echo ""
# Check for CUDA
echo "[4/4] Checking for CUDA..."
if python3 -c "import torch; print(torch.cuda.is_available())" 2>/dev/null | grep -q "True"; then
echo "✓ CUDA is available - GPU acceleration enabled"
cuda_version=$(python3 -c "import torch; print(torch.version.cuda)" 2>/dev/null)
echo " CUDA version: $cuda_version"
else
echo "⚠ CUDA not available - will use CPU (slower)"
echo " Consider installing CUDA for better performance"
fi
echo ""
# Create output directory
mkdir -p output
echo "✓ Created output directory"
echo ""
echo "========================================="
echo "Installation complete!"
echo "========================================="
echo ""
echo "Quick start:"
echo " 1. Activate environment: source venv/bin/activate"
echo " 2. Power on your Tello and connect to its WiFi"
echo " 3. Run: python -m tello_vision.app"
echo ""
echo "Examples:"
echo " - Test detector: python examples/test_detector.py --source 0"
echo " - Benchmark: python examples/benchmark.py"
echo " - Object following: python examples/object_follower.py"
echo ""
echo "Configuration:"
echo " Edit config.yaml to customize settings"
echo ""