Garment3dKabeer / Dockerfile
Stylique's picture
Upload 65 files
f498ac0 verified
raw
history blame
2.01 kB
# Use CUDA base image
FROM nvidia/cuda:11.8-devel-ubuntu20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.8 \
python3.8-dev \
python3-pip \
git \
wget \
curl \
build-essential \
cmake \
ninja-build \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Create symbolic link for python
RUN ln -s /usr/bin/python3.8 /usr/bin/python
# Upgrade pip
RUN python -m pip install --upgrade pip
# Set working directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
# Install PyTorch with CUDA support
RUN pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu118
# Install basic dependencies
RUN pip install -r requirements.txt
# Install CLIP
RUN pip install git+https://github.com/openai/CLIP.git
# Create packages directory
RUN mkdir -p packages
# Install nvdiffrast
WORKDIR /app/packages
RUN git clone https://github.com/NVlabs/nvdiffrast.git && \
cd nvdiffrast && \
pip install .
# Install PyTorch3D
WORKDIR /app/packages
RUN git clone https://github.com/facebookresearch/pytorch3d.git && \
cd pytorch3d && \
pip install .
# Install Fashion-CLIP
WORKDIR /app/packages
RUN git clone https://github.com/patrickjohncyh/fashion-clip.git && \
cd fashion-clip && \
pip install appdirs boto3 annoy validators transformers datasets
# Return to app directory
WORKDIR /app
# Copy application files
COPY . .
# Create necessary directories
RUN mkdir -p outputs meshes meshes_target
# Make setup script executable
RUN chmod +x setup_spaces.py
# Expose port
EXPOSE 7860
# Set the default command
CMD ["python", "app.py"]