-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathquickstart.sh
More file actions
executable file
·108 lines (84 loc) · 3.19 KB
/
quickstart.sh
File metadata and controls
executable file
·108 lines (84 loc) · 3.19 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
107
108
#!/bin/bash
# PyTorch Connectomics Quick Start Installation
# Works on most systems with CUDA 11+ or CPU-only
#
# Usage:
# bash quickstart.sh [env_name]
# curl -fsSL https://raw.githubusercontent.com/zudi-lin/pytorch_connectomics/refs/heads/master/quickstart.sh | bash -s -- myenv
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# Print functions
print_header() {
echo -e "\n${BOLD}${BLUE}========================================${NC}"
echo -e "${BOLD}${BLUE}$1${NC}"
echo -e "${BOLD}${BLUE}========================================${NC}\n"
}
print_success() {
echo -e "${GREEN}✓${NC} $1"
}
print_error() {
echo -e "${RED}✗${NC} $1"
}
print_warning() {
echo -e "${YELLOW}⚠${NC} $1"
}
print_info() {
echo -e "${BLUE}ℹ${NC} $1"
}
# Capture optional env name argument (default: pytc)
ENV_NAME=${1:-pytc}
# Main installation
main() {
print_header "🚀 PyTorch Connectomics Quick Start"
# Check if conda exists
if ! command -v conda &> /dev/null; then
print_warning "conda not found. Installing Miniconda..."
# Download Miniconda
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
MINICONDA_INSTALLER="/tmp/miniconda.sh"
curl -fsSL "$MINICONDA_URL" -o "$MINICONDA_INSTALLER"
bash "$MINICONDA_INSTALLER" -b -p "$HOME/miniconda3"
rm "$MINICONDA_INSTALLER"
# Add to PATH
export PATH="$HOME/miniconda3/bin:$PATH"
# Initialize conda for bash
eval "$($HOME/miniconda3/bin/conda shell.bash hook)"
print_success "Miniconda installed"
else
print_success "conda found"
fi
# Clone repo if not already in it
if [ ! -f "setup.py" ]; then
print_info "Cloning PyTorch Connectomics repository..."
git clone https://github.com/zudi-lin/pytorch_connectomics.git
cd pytorch_connectomics
print_success "Repository cloned"
else
print_success "Already in PyTorch Connectomics directory"
fi
# Run automated installer (non-interactive, basic mode)
print_info "Running automated installation (Python 3.11) into env '${ENV_NAME}'..."
python install.py --install-type basic --python 3.11 --env-name "${ENV_NAME}"
# Print completion message
print_header "✅ Installation Complete!"
echo -e "${GREEN}${BOLD}PyTorch Connectomics is ready to use!${NC}\n"
echo -e "${BOLD}Next steps:${NC}"
echo -e " 1. Activate the environment:"
echo -e " ${BOLD}conda activate ${ENV_NAME}${NC}\n"
echo -e " 2. Run a quick demo (30 seconds):"
echo -e " ${BOLD}python scripts/main.py --demo${NC}\n"
echo -e " 3. Try a tutorial (mitochondria segmentation):"
echo -e " ${BOLD}python scripts/main.py --config tutorials/lucchi.yaml --fast-dev-run${NC}\n"
echo -e "${BOLD}Need help?${NC}"
echo -e " 📚 Documentation: https://connectomics.readthedocs.io"
echo -e " 💬 Slack: https://join.slack.com/t/pytorchconnectomics/shared_invite/zt-obufj5d1-v5_NndNS5yog8vhxy4L12w"
echo -e " 🐛 Issues: https://github.com/zudi-lin/pytorch_connectomics/issues\n"
}
# Run main function
main