-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·50 lines (43 loc) · 1.29 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·50 lines (43 loc) · 1.29 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
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Local Image Privacy Mask - Setup ==="
# Check tesseract
if ! command -v tesseract &> /dev/null; then
echo "Tesseract not found. Installing via Homebrew..."
if command -v brew &> /dev/null; then
brew install tesseract
else
echo "ERROR: Homebrew not found. Please install tesseract manually."
exit 1
fi
else
echo "✓ Tesseract found: $(which tesseract)"
fi
# Check Chinese language pack
if ! tesseract --list-langs 2>&1 | grep -q "chi_sim"; then
echo "Installing Chinese language pack..."
if command -v brew &> /dev/null; then
brew install tesseract-lang
else
echo "WARNING: Cannot install chi_sim automatically. Install tesseract-lang manually."
fi
else
echo "✓ Chinese language pack (chi_sim) available"
fi
# Create venv
if [ ! -d "venv" ]; then
echo "Creating Python virtual environment..."
python3 -m venv venv
else
echo "✓ Virtual environment exists"
fi
# Install dependencies
echo "Installing Python dependencies..."
source venv/bin/activate
pip install -r requirements.txt -q
echo ""
echo "=== Setup Complete ==="
echo "Activate with: source venv/bin/activate"
echo "Usage: python3 scripts/mask_image.py <image_path>"