File size: 1,281 Bytes
8ab869c
fcccf3d
8ab869c
 
 
 
 
 
 
3a937e3
8ab869c
 
 
 
29d4d33
 
 
 
 
 
 
 
 
 
 
8ab869c
 
 
 
 
 
 
 
 
ae3e3b9
8ab869c
 
 
 
 
 
 
 
3a937e3
8ab869c
29d4d33
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
# Use an official PyTorch image with CUDA support as the base image
FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime

# Set the working directory
WORKDIR /app

# Copy the requirements files
COPY requirements.txt /app/
# Copy the FastAPI app code
COPY main.py /app/
RUN pip install --no-cache-dir -r requirements.txt

# Install dependencies
RUN apt-get update && apt-get install -y \
    libgl1-mesa-glx \
    libegl1-mesa \
    libxrandr2 \
    libxrandr2 \
    libxss1 \
    libxcursor1 \
    libxcomposite1 \
    libasound2 \
    libxi6 \
    libxtst6 \
    libglib2.0-0 \
    git \
    wget \
    && rm -rf /var/lib/apt/lists/*

# Clone the dust3r repository
RUN git clone --recursive https://github.com/tur-learning/dust3r /app/dust3r
WORKDIR /app/dust3r
RUN pip install --no-cache-dir -r requirements.txt
# RUN pip install --no-cache-dir -r requirements_optional.txt
RUN pip install opencv-python==4.8.0.74

# Download the model weights
RUN mkdir -p /app/dust3r/checkpoints && \
    wget https://huggingface.co/camenduru/dust3r/resolve/main/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P /app/dust3r/checkpoints

# Expose the port FastAPI is running on
EXPOSE 7860

WORKDIR /app
# Command to run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]