From 07644d2828b6e5731c7dada66ec2335c74f79501 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 26 Aug 2025 20:19:35 +0200 Subject: [PATCH] Refactor code for speed and clarity --- .github/workflows/push.yml | 2 +- README.md | 2 +- yoloe11s/predict.py | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 407e5b1..81eb2ee 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - model: [yolo11n,yolov8s-worldv2,yoloe11s] + model: [yolo11n, yolov8s-worldv2, yoloe11s] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/README.md b/README.md index 9c19d32..baf3599 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ cog push r8.im/ultralytics/yolo11n 1. **Setup secrets:** - Go to repository Settings → Secrets → Actions - - Add `REPLICATE_API_TOKEN` with your [Replicate API token](https://replicate.com/auth/token) + - Add `REPLICATE_API_TOKEN` with your [Replicate API token](https://replicate.com/signin?next=/auth/token) 2. **Deploy:** - **Manual**: Actions tab → "Push YOLO11n to Replicate" → Run workflow diff --git a/yoloe11s/predict.py b/yoloe11s/predict.py index 20df8d2..85c2532 100644 --- a/yoloe11s/predict.py +++ b/yoloe11s/predict.py @@ -22,13 +22,14 @@ def setup(self) -> None: def re_init_model(self, class_names: str) -> None: """Re-Initialize model with class names.""" - if class_names.strip() != "": + if not class_names.strip(): + # Load YOLOE-11s model prompt free model into memory + self.model = YOLOE("yoloe-11s-seg-pf.pt") + + else: self.model = YOLOE("yoloe-11s-seg.pt") class_list = class_names.split(", ") self.model.set_classes(class_list, self.model.get_text_pe(class_list)) - else: - # Load YOLOE-11s model prompt free model into memory - self.model = YOLOE("yoloe-11s-seg-pf.pt") def predict( self,