File size: 1,399 Bytes
4cb9fcc
 
 
 
 
31a189d
4cb9fcc
 
 
f689df8
 
 
31a189d
4cb9fcc
 
 
31a189d
 
 
 
f689df8
 
 
 
31a189d
 
 
 
 
 
 
 
4cb9fcc
 
31a189d
 
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
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

FROM python:3.9

# Create a new user and set the working directory
RUN useradd -m -u 1000 user
WORKDIR /app

# Set the CUDA_HOME environment variable
ENV CUDA_HOME=/usr/local/cuda

# Copy and install Python dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Install specific versions of PyTorch and other dependencies
RUN pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118 \
    && pip install -U xformers --index-url https://download.pytorch.org/whl/cu118

# Clone and install the modified gaussian splatting repository
RUN git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization \
    && pip install ./diff-gaussian-rasterization

# Install nvdiffrast for mesh extraction
RUN pip install git+https://github.com/NVlabs/nvdiffrast

# Create a directory for pretrained models and download the model
RUN mkdir /app/pretrained && cd /app/pretrained \
    && wget https://huggingface.co/ashawkey/LGM/resolve/main/model_fp16_fixrot.safetensors

# Copy the application code
COPY --chown=user . /app

# Set the command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]