Spaces:
Paused
Paused
File size: 1,753 Bytes
f1cb539 57be1f5 c61442c dfdb21b c61442c 80cedcf 756f2ad 80cedcf 756f2ad 826be42 756f2ad 80cedcf 80ff3af c61442c f7ed84e 756f2ad cbf15a9 80cedcf 798048d 756f2ad 4a31e34 756f2ad 80cedcf 798048d 4a31e34 2bd8bfe e30e55f fd31fbe 6131932 2bd8bfe 3fcc1dd b428ba7 fd31fbe 6131932 c61442c 756f2ad 80cedcf 80ff3af 37842be 4a31e34 | 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 | FROM pytorch/pytorch:2.7.1-cuda12.6-cudnn9-devel
ENV CUDA_HOME=/usr/local/cuda
ENV PATH="${CUDA_HOME}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
ENV TORCH_CUDA_ARCH_LIST="7.5"
ENV USE_CUDA=1
# Verify CUDA setup
RUN nvcc --version && which nvcc
RUN apt-get update && apt-get install -y \
git fish tmux curl ffmpeg \
libgl1-mesa-glx libglib2.0-0 \
build-essential ninja-build python3.10-venv \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 1000 user
# Create HF cache with correct ownership
ENV HF_HOME=/home/user/.cache/huggingface
RUN mkdir -p $HF_HOME && chown -R user:user /home/user
ENV OMP_NUM_THREADS=1
ENV MKL_NUM_THREADS=1
ENV NUMEXPR_NUM_THREADS=1
# Switch to user before creating venv
USER user
WORKDIR /home/user/app
# Create virtualenv
RUN python3 -m venv /home/user/venv
ENV PATH="/home/user/venv/bin:$PATH"
# Dependencies
COPY --chown=user:user requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
RUN git clone https://github.com/video-fm/video-sam2.git ./video-sam2 && \
git clone https://github.com/video-fm/GroundingDINO.git ./groundingdino && \
git clone https://github.com/kevinxuez/LASER.git ./laser && \
git clone https://github.com/kevinxuez/vine_hf.git ./vine_hf
# Editable installs
RUN pip install --no-cache-dir -e ./video-sam2 && \
pip install --no-cache-dir --use-pep517 -e ./groundingdino && \
pip install --no-cache-dir -e ./laser && \
pip install --no-cache-dir -e ./vine_hf
RUN cd groundingdino && \
python3 setup.py build_ext --force --inplace
# Copy app
COPY --chown=user:user . .
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
CMD ["python3", "app.py"] |