Spaces:
Sleeping
Sleeping
Implement initial version of SegFormer training pipeline with dataset parsing and model training functionalities. Added Dockerfile for environment setup, utility scripts for parsing and training, and Gradio interface for user interaction.
e4aef33
| FROM pytorch/pytorch:2.8.0-cuda12.9-cudnn9-runtime | |
| ENV PYTHONUNBUFFERED=1 | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| # Install system dependencies for building Python packages | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libffi-dev \ | |
| libssl-dev \ | |
| ffmpeg \ | |
| libsm6 \ | |
| libxext6 \ | |
| libmagic1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create virtual environment for Sly (keep isolated) | |
| RUN python -m venv /app/.venv-sly | |
| RUN /app/.venv-sly/bin/pip install --upgrade pip | |
| COPY --chown=user requirements-sly.txt requirements-sly.txt | |
| RUN /app/.venv-sly/bin/pip install -r requirements-sly.txt | |
| # Install Gradio and other dependencies | |
| RUN pip install --upgrade pip | |
| COPY --chown=user requirements.txt requirements.txt | |
| RUN pip install -r requirements.txt | |
| # Copy the rest of the app | |
| COPY --chown=user . . | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| CMD ["python", "app.py"] | |