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
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM pytorch/pytorch:2.5.1-cuda12.1-cudnn9-devel

# Prevent Python from buffering stdout/stderr
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive

# Install essential system packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libavutil-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
pkg-config \
build-essential \
libffi-dev \
wget \
python3-opencv && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /workspace
COPY . .

# Install Python packages
RUN pip install --upgrade pip setuptools && \
pip install -r requirements.txt && \
pip install hydra-core iopath decord

# Download SAM2 model checkpoints
RUN cd sam2/checkpoints && chmod +x download_ckpts.sh && ./download_ckpts.sh

# Default command
CMD ["/bin/bash"]
21 changes: 21 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3.9"

services:
samurai:
build:
context: .
dockerfile: Dockerfile
container_name: samurai_dev
runtime: nvidia # Enable GPU access
environment:
- NVIDIA_VISIBLE_DEVICES=all # Expose all GPUs
- NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
volumes:
- .:/workspace # Mount project directory
working_dir: /workspace # Set working directory inside container
stdin_open: true # Keep STDIN open for interactive use
tty: true # Allocate a pseudo-TTY
ipc: host # Share IPC namespace (for performance)
ulimits:
memlock: -1 # Disable memory locking limits
stack: 67108864 # Increase stack size to 64MB