facebookresearch / SlowFast

PySlowFast: video understanding codebase from FAIR for reproducing state-of-the-art video models.
Apache License 2.0
6.38k stars 1.18k forks source link

Working Dockerfile if anyone needs #691

Closed clydebailey closed 6 months ago

clydebailey commented 6 months ago
FROM  nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:deadsnakes/ppa && \
    apt-get update && \
    apt-get install -y python3.10 python3.10-dev
#
# Update and install necessary packages as root
RUN apt-get update && apt-get install -y \
    python3.10 python3.10-dev python3.10-distutils \
    python3-opencv ca-certificates git wget sudo ninja-build \
    && rm -rf /var/lib/apt/lists/*

# Make Python 3.8 available as python3
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

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

RUN pip3.10 install --upgrade pip
# Install necessary Python packages as root
RUN pip3.10 install  av ffmpeg simplejson iopath psutil tensorboard

RUN pip3.10 install numpy
RUN pip3 install numpy --upgrade
# Install cmake, tensorboard, and torch as root
RUN pip3.10 install tensorboard cmake
#RUN pip3.10 install torch torchvision -f https://download.pytorch.org/whl/cu111/torch_stable.html
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# Install fvcore, detectron2, and other dependencies as root
RUN pip3.10 install 'git+https://github.com/facebookresearch/fvcore'
RUN git clone https://github.com/facebookresearch/detectron2 /detectron2_repo
RUN pip3.10 install -e /detectron2_repo

RUN git clone https://github.com/facebookresearch/slowfast /slowfast
RUN pip3.10 install pandas
COPY setup.py /slowfast/setup.py
WORKDIR /slowfast
RUN python3.10 setup.py build develop

RUN git clone https://github.com/facebookresearch/pytorchvideo.git /pytorchvideo
WORKDIR /pytorchvideo
RUN pip3 install -e .