Skip to content

ultralytics/replicate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Ultralytics logo

๐Ÿš€ Ultralytics Replicate

Deploy Ultralytics YOLO models to Replicate with ready-to-use Cog configurations and automated CI/CD workflows.

Push YOLO to Replicate Ultralytics Actions Codecov

Ultralytics Discord Ultralytics Forums Ultralytics Reddit

Replicate AI

๐Ÿ—‚๏ธ Repository Structure

This repository provides optimized Replicate deployments for YOLO11n, YOLOv8s WorldV2, and YOLOE-11S models with an automated CI/CD workflow.

ultralytics/replicate/
โ”‚
โ”œโ”€โ”€ yolo11n/                  # YOLO11n model deployment
โ”‚   โ”œโ”€โ”€ cog.yaml              # Cog configuration
โ”‚   โ”œโ”€โ”€ predict.py            # Prediction interface
โ”‚   โ””โ”€โ”€ README.md             # Model documentation
โ”œโ”€โ”€ yolov8s-worldv2/          # YOLOv8s WorldV2 model deployment
โ”‚   โ”œโ”€โ”€ cog.yaml              # Cog configuration
โ”‚   โ”œโ”€โ”€ predict.py            # Prediction interface
โ”‚   โ””โ”€โ”€ README.md             # Model documentation
โ”œโ”€โ”€ yoloe11s/                 # YOLOE-11S model deployment
โ”‚   โ”œโ”€โ”€ cog.yaml              # Cog configuration
โ”‚   โ”œโ”€โ”€ predict.py            # Prediction interface
โ”‚   โ””โ”€โ”€ README.md             # Model documentation
โ”œโ”€โ”€ assets/                   # Sample images for workflow smoke tests
โ”‚
โ”œโ”€โ”€ .github/workflows/        # Automated deployment
โ”‚   โ”œโ”€โ”€ push.yml              # Model deployment workflow
โ”‚   โ”œโ”€โ”€ ci.yml                # Code quality checks
โ”‚   โ””โ”€โ”€ format.yml            # Code formatting
โ”‚
โ”œโ”€โ”€ test_prediction.py        # Local YOLO11n testing utility
โ”œโ”€โ”€ requirements.txt          # Dependencies
โ”œโ”€โ”€ LICENSE                   # AGPL-3.0 license
โ””โ”€โ”€ README.md                 # This file

โšก Quick Start

Deploy a Model

Models deploy to the corresponding Replicate endpoints:

# Clone repository
git clone https://github.com/ultralytics/replicate.git
cd replicate

# Deploy YOLO11n
cd yolo11n
python download.py
cog login
cog push r8.im/ultralytics/yolo11n

# Or deploy another configured model
cd ../yolov8s-worldv2
python download.py
cog push r8.im/ultralytics/yolov8s-worldv2

cd ../yoloe11s
python download.py
cog push r8.im/ultralytics/yoloe-11s

Automated Deployment with GitHub Actions

  1. Setup secrets:

    • Go to repository Settings โ†’ Secrets โ†’ Actions
    • Add REPLICATE_API_TOKEN with your Replicate API token
  2. Deploy:

    • Manual: Actions tab โ†’ "Push YOLO to Replicate" โ†’ Run workflow
    • Automatic: Push changes to main builds, tests, and deploys each configured model

๐Ÿ› ๏ธ Installation

Install Cog (Replicate's deployment tool):

sudo curl -o /usr/local/bin/cog -L https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)
sudo chmod +x /usr/local/bin/cog

For local development and testing:

pip install -r requirements.txt

๐ŸŽฏ Available Models

Directory Replicate model Predictor Notes
yolo11n/ r8.im/ultralytics/yolo11n YOLO Official YOLO11n object detection model
yolov8s-worldv2/ r8.im/ultralytics/yolov8s-worldv2 YOLOWorld Open-vocabulary YOLOv8s WorldV2 model
yoloe11s/ r8.im/ultralytics/yoloe-11s YOLOE YOLOE-11S segmentation model with class prompt support

๐Ÿ”ง Model Setup

Each model directory includes a download.py script used by the deployment workflow before cog build:

python yolo11n/download.py
python yolov8s-worldv2/download.py
python yoloe11s/download.py

๐Ÿงช Local Testing

Test the model locally before deploying:

# Test YOLO11n
python yolo11n/download.py
python test_prediction.py --model yolo11n --image assets/bus.jpg

๐Ÿš€ Features

  • ๐ŸŽ๏ธ Optimized: PyTorch model for fast inference
  • ๐Ÿค– Automated: GitHub Actions for CI/CD
  • ๐Ÿ“ฆ Ready-to-use: Pre-configured deployments for multiple YOLO models
  • ๐Ÿ“Š Scalable: Auto-scaling Replicate infrastructure
  • ๐ŸŽฏ Focused: One Cog configuration per model

๐Ÿ’ก Contribute

Ultralytics thrives on community collaboration, and we deeply value your contributions! Whether it's reporting bugs, suggesting features, or submitting code changes, your involvement is crucial.

  • Reporting Issues: Encounter a bug? Please report it on GitHub Issues.
  • Feature Requests: Have an idea for improvement? Share it via GitHub Issues.
  • Pull Requests: Want to contribute code? Please read our Contributing Guide first, then submit a Pull Request.
  • Feedback: Share your thoughts and experiences by participating in our official Survey.

A heartfelt thank you ๐Ÿ™ goes out to all our contributors! Your efforts help make Ultralytics tools better for everyone.

Ultralytics open-source contributors

๐Ÿ“„ License

Ultralytics offers two licensing options to accommodate diverse needs:

  • AGPL-3.0 License: Ideal for students, researchers, and enthusiasts passionate about open collaboration and knowledge sharing. This OSI-approved open-source license promotes transparency and community involvement. See the LICENSE file for details.
  • Enterprise License: Designed for commercial applications, this license permits the seamless integration of Ultralytics software and AI models into commercial products and services, bypassing the copyleft requirements of AGPL-3.0. For commercial use cases, please inquire about an Ultralytics Enterprise License.

๐Ÿ“ฎ Contact

For bug reports or feature suggestions related to this project or other Ultralytics projects, please use GitHub Issues. For general questions, discussions, and community support, join our Discord server!


Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics BiliBili space Ultralytics Discord

About

Deploy YOLO models to Replicate with ready-to-use Cog configurations and automated CI/CD. Includes optimized deployments for YOLO11, and reference implementations for custom model deployment.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Generated from ultralytics/template