feat: 🚀 add YOLOv8s WorldV2 deployment workflow and model predictor #93
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license | |
| name: Push YOLO to Replicate | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build_test_push: | |
| name: Build, Test & Push Model | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| model: [yolo11n,yolov8s-worldv2] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install dependencies | |
| run: uv pip install --system ultralytics --extra-index-url https://download.pytorch.org/whl/cpu | |
| - name: Setup Cog | |
| uses: replicate/setup-cog@v2 | |
| with: | |
| token: ${{ secrets.REPLICATE_API_TOKEN }} | |
| - name: Download model weights | |
| run: python ${{ matrix.model }}/download.py | |
| - name: Build model image | |
| working-directory: ${{ matrix.model }} | |
| run: cog build | |
| - name: Test model | |
| working-directory: ${{ matrix.model }} | |
| run: cog predict -i image=@../assets/bus.jpg -i conf=0.25 -i iou=0.45 | |
| - name: Push to Replicate | |
| if: github.ref == 'refs/heads/main' | |
| working-directory: ${{ matrix.model }} | |
| run: cog push |