Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
.dockerignore
compose.yml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
__pycache__/
outputs/*
weights/*
weights/*
!weights/.gitkeep
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies
# We split this to ensure software-properties-common is installed before add-apt-repository
RUN apt-get update && apt-get install -y \
software-properties-common \
git \
git-lfs \
wget \
build-essential \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install

# Add Python 3.8 PPA
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y \
python3.8 \
python3.8-dev \
python3.8-distutils \
&& rm -rf /var/lib/apt/lists/*

# Install pip for Python 3.8
RUN wget https://bootstrap.pypa.io/pip/3.8/get-pip.py && \
python3.8 get-pip.py && \
rm get-pip.py

# Set python3.8 as default python
RUN ln -s /usr/bin/python3.8 /usr/bin/python

# Install PyTorch and dependencies
# We install torch first to ensure the correct cuda version is picked up
RUN pip install --no-cache-dir torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118

# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire repository
COPY . /app

# Install customized 'Forward-Warp' package
WORKDIR /app/dependency/Forward-Warp
RUN chmod +x install.sh && ./install.sh

WORKDIR /app
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,40 @@ cd StereoCrafter
pip install -r requirements.txt
```


#### 4. Install customized 'Forward-Warp' package for forward splatting
```
cd ./dependency/Forward-Warp
chmod a+x install.sh
./install.sh
```

## 🛠️ Installation with Docker

#### 1. Set up the environment
Docker will run the code on Python 3.8 and Cuda 11.8.
You need to install Docker with CUDA support first.

#### 2. Clone the repo
```bash
# use --recursive to clone the dependent submodules
git clone --recursive https://github.com/TencentARC/StereoCrafter
cd StereoCrafter
```

#### 3. Download models
Please refer to "📦 Model Weights" for downloading the models.

#### 4. Start the Docker image
```bash
docker compose run stereo_crafter --build --remove-orphans
```

## 📦 Model Weights

#### 1. Download the [SVD img2vid model](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt-1-1) for the image encoder and VAE.

```bash
# in StereoCrafter project root directory
mkdir weights
cd ./weights
git lfs install
git clone https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt-1-1
Expand Down
14 changes: 14 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
stereo_crafter:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./test:/app/test
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
Empty file added weights/.gitkeep
Empty file.