| #!/bin/bash |
|
|
| |
| CONDA_BASE="/home/${USER}/anaconda3" |
| ENV_NAME="sapiens" |
| PYTHON_VERSION="3.10" |
| PYTORCH_VERSION="pytorch-cuda=12.1" |
|
|
| |
| source "${CONDA_BASE}/etc/profile.d/conda.sh" |
|
|
| |
| conda_env_exists() { |
| conda env list | grep -q "$1" |
| } |
|
|
| |
| print_green() { |
| echo -e "\033[0;32m$1\033[0m" |
| } |
|
|
| |
| if conda_env_exists "${ENV_NAME}"; then |
| print_green "Environment '${ENV_NAME}' exists. Removing..." |
| conda env remove -n "${ENV_NAME}" |
| fi |
|
|
| |
| print_green "Creating environment '${ENV_NAME}'..." |
| conda create -n "${ENV_NAME}" python="${PYTHON_VERSION}" -y |
| conda activate "${ENV_NAME}" |
|
|
| |
| print_green "Installing pip..." |
| conda install pip -y |
|
|
| |
| print_green "Installing fish terminal..." |
| conda install -c conda-forge fish -y |
|
|
| |
| print_green "Installing PyTorch, torchvision, torchaudio, and CUDA..." |
| conda install pytorch torchvision torchaudio "${PYTORCH_VERSION}" -c pytorch -c nvidia -y |
|
|
| |
| print_green "Installing additional Python packages..." |
| pip install chumpy scipy munkres tqdm cython fsspec yapf==0.40.1 matplotlib packaging omegaconf ipdb ftfy regex |
| pip install json_tricks terminaltables modelindex prettytable albumentations libcom |
|
|
| |
| cd "$(dirname "$0")/.." |
|
|
| |
| pip_install_editable() { |
| print_green "Installing $1..." |
| cd "$1" || exit |
| pip install -e . -v |
| cd - || exit |
| print_green "Finished installing $1." |
| } |
|
|
| |
| pip_install_editable "engine" |
|
|
| |
| pip_install_editable "cv" |
| pip install -r "cv/requirements/optional.txt" |
|
|
| |
| pip_install_editable "pretrain" |
|
|
| |
| pip_install_editable "pose" |
|
|
| |
| pip_install_editable "det" |
|
|
| |
| pip_install_editable "seg" |
|
|
| print_green "Installation done!" |
|
|