File size: 1,083 Bytes
e195352
 
e697160
a0a2cbe
e195352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e697160
 
 
 
e3e5d76
e697160
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
FROM nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV MPLCONFIGDIR=/tmp/matplotlib
RUN apt-get update && apt-get install -y \
    python3.11 \
    python3.11-venv \
    python3-pip \
    git \
    software-properties-common \
    wget \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
RUN add-apt-repository -y -r ppa:jonathonf/ffmpeg-4 \
    && apt-get update \
    && apt-get install -y ffmpeg \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
RUN pip3 install numpy matplotlib pillow gradio==3.38.0 opencv-python ffmpeg-python
RUN git clone https://github.com/facebookresearch/segment-anything-2.git
WORKDIR /app/segment-anything-2
RUN pip3 install -e .
# RUN pip3 install -e ".[demo]"
WORKDIR /app/segment-anything-2/checkpoints
RUN ./download_ckpts.sh
WORKDIR /app
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
COPY app.py /app/app.py
COPY assets /app/assets
CMD ["python3", "-u", "app.py"]