-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathinstall.sh
executable file
·124 lines (105 loc) · 3.39 KB
/
install.sh
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
# Parse command-line args
# e - env name to use
# c - cuda home path
# m - if set, use mamba (optional)
print_usage() {
printf "Usage: ..."
}
ENV_NAME=""
CUDA_HOME=""
USE_MAMBA=0
while getopts 'me:c:' flag; do
case "${flag}" in
m) USE_MAMBA=1 ;;
e) ENV_NAME="${OPTARG}" ;;
c) CUDA_HOME="${OPTARG}" ;;
*) print_usage
exit 1 ;;
esac
done
# Infer which conda command to use
if [[ "${USE_MAMBA}" == 1 ]]; then
CONDA_CMD="mamba"
else
CONDA_CMD="conda"
fi
# 2. Create Conda env
if ${CONDA_CMD} info --envs | grep -q ${ENV_NAME};
then
printf "Conda environment [${ENV_NAME}] already exists, skipping creation"
else
printf "\n****************************************\n"
printf "Creating conda environment for ACDC, named [${ENV_NAME}]..."
printf "\n****************************************\n"
${CONDA_CMD} create -y -n ${ENV_NAME} python=3.10
fi
# Activate the environment, and terminate early if it fails
# See https://github.com/conda/conda/issues/7980#issuecomment-524154596 for esoteric syntax
eval "$(conda shell.bash hook)"
if [[ "${USE_MAMBA}" == 1 ]]; then
# Additionally activate mamba
source "${CONDA_EXE%/bin/conda}/etc/profile.d/mamba.sh"
fi
${CONDA_CMD} activate ${ENV_NAME}
if [[ "${CONDA_DEFAULT_ENV}" != ${ENV_NAME} ]]; then
printf "Conda environment [${ENV_NAME}] is not activated, instead, [${CONDA_DEFAULT_ENV}] is activated. terminating.\n"
exit 1
fi
# 3. Install ACDC
printf "\n****************************************\n"
printf "Installing ACDC..."
printf "\n****************************************\n"
${CONDA_CMD} install conda-build
pip install -r requirements.txt
pip install -e .
# 4. Install deps
printf "\n****************************************\n"
printf "Installing Dependencies..."
printf "\n****************************************\n"
mkdir -p deps
cd deps
# DINOv2
if [ ! -d "dinov2" ]; then
git clone https://github.com/facebookresearch/dinov2.git
fi
cd dinov2 && conda-develop . && cd ..
# SAMv2
if [ ! -d "segment-anything-2" ]; then
git clone https://github.com/facebookresearch/segment-anything-2.git
fi
cd segment-anything-2 && pip install -e . && cd ..
# GroundingDINO
if [ ! -d "GroundingDINO" ]; then
git clone https://github.com/IDEA-Research/GroundingDINO.git
fi
cd GroundingDINO && export CUDA_HOME=${CUDA_HOME} && pip install --no-build-isolation -e . && cd ..
# PerspectiveFields
if [ ! -d "PerspectiveFields" ]; then
git clone https://github.com/jinlinyi/PerspectiveFields.git
fi
cd PerspectiveFields && pip install -e . && cd ..
# Depth-Anything-V2
if [ ! -d "Depth-Anything-V2" ]; then
git clone https://github.com/DepthAnything/Depth-Anything-V2.git
fi
cd Depth-Anything-V2 && pip install -r requirements.txt && conda-develop . && cd ..
# CLIP
pip install git+https://github.com/openai/CLIP.git
# faiss
${CONDA_CMD} install -c pytorch -c nvidia faiss-gpu=1.8.0
# robomimic
if [ ! -d "robomimic" ]; then
git clone https://github.com/ARISE-Initiative/robomimic.git --branch "diffusion-updated" --single-branch
fi
cd robomimic && pip install -e . && cd ..
# OmniGibson
if [ ! -d "OmniGibson" ]; then
git clone https://github.com/StanfordVL/OmniGibson.git
fi
cd OmniGibson && pip install -e . && python -m omnigibson.install --no-install-datasets && cd ..
# Move out of deps dir
cd ..
printf "\n****************************************\n"
printf "Completed ACDC Installation!"
printf "\n****************************************\n"