LiveWorld / LiveWorld-Code /setup /install_test_env.sh
cszhilu1998's picture
Upload folder using huggingface_hub
e6af083 verified
Raw History Blame Contribute Delete
1.62 kB
#!/usr/bin/env bash
# Run inside an activated Python 3.11 environment; no model downloads.
set -euo pipefail
cd "$(dirname "$0")/.."
python - <<'PY'
import sys
if sys.version_info[:2] != (3, 11):
raise SystemExit('Use Python 3.11: conda create -n liveworld python=3.11 ffmpeg -c conda-forge -y')
PY
if ! command -v ffmpeg >/dev/null || ! command -v ffprobe >/dev/null; then
echo 'Install FFmpeg first: conda install -c conda-forge ffmpeg -y' >&2
exit 1
fi
if ! python - <<'PY'
import torch, torchvision, torchaudio
assert torch.__version__.startswith('2.9.1') and torch.version.cuda == '12.8'
assert torchvision.__version__.startswith('0.24.1')
assert torchaudio.__version__.startswith('2.9.1')
PY
then
python -m pip install torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1 \
--index-url https://download.pytorch.org/whl/cu128
fi
python -m pip install -r setup/requirements_inference.txt
python -m pip install ninja packaging psutil wheel setuptools
if ! python - <<'PY'
import flash_attn
assert flash_attn.__version__ == '2.8.3'
PY
then
MAX_JOBS="${MAX_JOBS:-4}" python -m pip install flash_attn==2.8.3 --no-build-isolation --no-deps --force-reinstall
fi
python -m pip install --no-deps --no-build-isolation -e . -e misc/sam3
python - <<'PY'
from pathlib import Path
import site
root=Path.cwd().resolve()
(Path(site.getsitepackages()[0])/'stream3r.pth').write_text(str(root/'misc/STream3R')+'\n')
from sam3.model_builder import build_sam3_video_predictor
from stream3r.models.stream3r import STream3R
from pano_inference.dataset import PanoDataset
print('LiveWorld K1/K21 environment imports passed.')
PY