-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·87 lines (73 loc) · 2.64 KB
/
install.sh
File metadata and controls
executable file
·87 lines (73 loc) · 2.64 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
#!/bin/bash
# Watermark Eraser - One-Step Installation Script with AI Detection
# This script installs the watermark-eraser skill to your local environment
set -e # Exit on error
echo "🚀 Installing Watermark Eraser Skill with AI Detection..."
echo ""
# Define installation directory
INSTALL_DIR="${HOME}/skills/watermark-eraser"
# Check if directory already exists
if [ -d "$INSTALL_DIR" ]; then
echo "⚠️ Directory $INSTALL_DIR already exists."
read -p "Do you want to overwrite it? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Installation cancelled."
exit 1
fi
rm -rf "$INSTALL_DIR"
fi
# Create parent directory
mkdir -p "$(dirname "$INSTALL_DIR")"
# Clone repository
echo "📥 Cloning repository..."
git clone https://github.com/moose-lab/watermark-eraser.git "$INSTALL_DIR"
# Navigate to installation directory
cd "$INSTALL_DIR"
# Install Python dependencies
echo ""
echo "📦 Installing Python dependencies..."
pip install -q -r requirements.txt
# Download AI detection model
echo ""
echo "🤖 Downloading AI watermark detection model..."
MODEL_DIR="${HOME}/models"
MODEL_FILE="$MODEL_DIR/best_watermark_model_mit_b5_best.pth"
mkdir -p "$MODEL_DIR"
if [ ! -f "$MODEL_FILE" ]; then
echo " Downloading from Hugging Face (this may take a minute)..."
curl -L -o "$MODEL_FILE" "https://huggingface.co/Sanster/watermark-segmentation/resolve/main/best_watermark_model_mit_b5_best.pth"
echo " ✓ Model downloaded successfully"
else
echo " ✓ Model already exists"
fi
# Test installation
echo ""
echo "🧪 Testing installation..."
python3 -c "import cv2, torch, simple_lama_inpainting, segmentation_models_pytorch; print('✓ All dependencies installed successfully')"
echo ""
echo "✅ Installation complete!"
echo ""
echo "📍 Installation directory: $INSTALL_DIR"
echo "📍 AI model location: $MODEL_FILE"
echo ""
echo "🎯 Quick Start:"
echo ""
echo " # AI Detection (Recommended - works with any watermark)"
echo " python $INSTALL_DIR/src/batch_processor_v2.py \\"
echo " --input /path/to/images/ \\"
echo " --output /path/to/results/ \\"
echo " --detection ai \\"
echo " --batch"
echo ""
echo " # Fixed Detection (Faster, for specific watermarks)"
echo " python $INSTALL_DIR/src/batch_processor_v2.py \\"
echo " --input /path/to/images/ \\"
echo " --output /path/to/results/ \\"
echo " --detection fixed \\"
echo " --batch"
echo ""
echo "📖 Usage with AI Agents (Claude, GPT, etc.):"
echo " \"Use the watermark-eraser skill with AI detection to remove watermarks from my images\""
echo ""
echo "🎉 Ready to remove watermarks intelligently!"