Spaces:
Running
on
Zero
Running
on
Zero
FROM nvidia/cuda:12.2.0-cudnn8-devel-ubuntu22.04 | |
# Set a working directory | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
python3 \ | |
python3-pip \ | |
libgl1-mesa-glx \ | |
libglib2.0-0 \ | |
libsm6 \ | |
libxext6 \ | |
libxrender1 \ | |
ffmpeg \ | |
libicu-dev \ | |
git \ | |
wget \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Clone the repository with submodules | |
RUN git clone --recurse-submodules https://github.com/microsoft/TRELLIS.git . | |
# Install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Install aspose.threed | |
RUN pip install aspose-threed | |
# Set environment variable | |
ENV SPCONV_ALGO=native | |
# Create assets directories | |
RUN mkdir -p assets/example_image assets/example_multi_image | |
# Download example images (from the GitHub repository) | |
RUN wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/apple_3.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/avocado_2.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/banana_4.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/buddha_3.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/cat_1.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/cat_2.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/chair_2.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/cherries_1.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/dog_1.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/hotdog_1.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/mushroom_1.png \ | |
&& wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/soccer_1.png | |
RUN wget -P assets/example_multi_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_multi_image/chair_1.png \ | |
&& wget -P assets/example_multi_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_multi_image/chair_2.png \ | |
&& wget -P assets/example_multi_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_multi_image/chair_3.png | |
# Expose the Gradio port | |
EXPOSE 7860 | |
# Command to run the application | |
CMD ["python", "app.py"] |