| | |
| | FROM python:3.8.20 |
| |
|
| | ENV DEBIAN_FRONTEND=noninteractive \ |
| | PIP_NO_CACHE_DIR=1 |
| |
|
| | |
| | RUN apt-get update && apt-get install -y --no-install-recommends \ |
| | git build-essential \ |
| | libgl1 libglib2.0-0 ffmpeg \ |
| | && rm -rf /var/lib/apt/lists/* |
| |
|
| | |
| | RUN python -m pip install -U pip "setuptools<70" wheel |
| |
|
| | |
| | RUN python -m pip install "torch==2.3.*" "torchvision==0.18.*" --index-url https://download.pytorch.org/whl/cpu |
| |
|
| | |
| | RUN python -m pip install -U openmim \ |
| | && mim install "mmengine>=0.10,<1.0" \ |
| | && mim install "mmcv>=2.0.0rc4,<2.2.0" \ |
| | && mim install "mmdet>=3.2.0,<4.0.0" |
| |
|
| |
|
| | RUN python -m pip install transformers>=4.35 |
| |
|
| | ENV XDG_CACHE_HOME=/tmp/cache |
| | RUN mkdir -p /tmp/cache && chmod -R 777 /tmp/cache |
| |
|
| | ENV MPLCONFIGDIR=/tmp/matplotlib |
| | RUN mkdir -p $XDG_CACHE_HOME/fontconfig \ |
| | && mkdir -p $MPLCONFIGDIR \ |
| | && chmod -R 777 /tmp |
| |
|
| | ENV HF_HOME=/tmp/huggingface \ |
| | HUGGINGFACE_HUB_CACHE=/tmp/huggingface/hub \ |
| | TRANSFORMERS_CACHE=/tmp/huggingface/transformers |
| | RUN mkdir -p /tmp/huggingface/hub && mkdir -p /tmp/huggingface/transformers && chmod -R 777 /tmp/huggingface |
| |
|
| | RUN python -m pip install gradio>=4.0.0 |
| | RUN python -m pip install supervision |
| | RUN python -m pip install timm |
| |
|
| | |
| | WORKDIR /app |
| | |
| | COPY . . |
| |
|
| | EXPOSE 7860 |
| | ENV PORT=7860 |
| | |
| | |
| |
|
| | CMD ["python", "app.py"] |