Spaces:
Runtime error
Runtime error
| FROM python:3.10-slim-bookworm | |
| # 1) System dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1-mesa-glx libglib2.0-0 build-essential cmake git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # 2) Upgrade pip | |
| RUN pip install --upgrade pip | |
| # 3) Install Python dependencies (excluding mmcv/mmcv-full) | |
| COPY requirements.txt . | |
| RUN sed -i '/mmcv/d;/mmcv-full/d' requirements.txt && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # 4) Install OpenMIM and mmcv/mmdet/mmdet3d via mim | |
| RUN pip install openmim==0.3.9 && \ | |
| mim install mmcv==2.1.0 && \ | |
| mim install mmdet==3.3.0 && \ | |
| mim install mmdet3d==1.4.0 | |
| # 5) Clone MMDetection3D to get 'projects/DETR3D' | |
| RUN git clone https://github.com/open-mmlab/mmdetection3d.git /app/mmdetection3d | |
| # 6) Set PYTHONPATH to include mmdetection3d for custom_imports to work | |
| COPY model/DETR3D/detr3d_head.py /app/mmdetection3d/projects/DETR3D/detr3d/detr3d_head.py | |
| COPY model/DETR3D/detr3d.py /app/mmdetection3d/projects/DETR3D/detr3d/detr3d.py | |
| COPY model/DETR3D/detr3d_r101_gridmask.py /app/mmdetection3d/projects/DETR3D/configs/detr3d_r101_gridmask.py | |
| COPY model/PETR/petr_vovnet_gridmask_p4_800x320.py /app/mmdetection3d/projects/PETR/configs/petr_vovnet_gridmask_p4_800x320.py | |
| ENV PYTHONPATH=/app/mmdetection3d:$PYTHONPATH | |
| # 7) Copy application code | |
| COPY . . | |
| # 8) Expose port and run the app | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |