Skip to content

Conversation

@pderrenger
Copy link
Member

@pderrenger pderrenger commented Aug 26, 2025

This Ultralytics PR refactors code to improve performance and readability. 🔄

Key changes include:

  • 🚀 Optimized various functions for faster execution.
  • 🧩 Simplified complex logic for better understanding and maintenance.
  • 🗑️ Removed redundant code to streamline operations.
  • 📚 Improved code structure and organization.

These changes aim to enhance the overall quality and efficiency of the code. 🌟

Learn more about Ultralytics:

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Streamlines Replicate configs and clarifies YOLOE-11s model initialization, reducing image bloat and improving code readability 🧹⚡

📊 Key Changes

  • Removed unnecessary system package libgl1-mesa-glx from cog.yaml for:
    • yolo11n
    • yoloe11s
    • yolov8s-worldv2
  • Cleaned up GitHub Actions matrix formatting for readability.
  • Simplified and clarified re_init_model logic in yoloe11s/predict.py:
    • Explicitly loads the prompt-free model when no classes are provided.
    • Loads the standard segmentation model and applies custom classes when specified.

🎯 Purpose & Impact

  • Smaller, faster builds: Dropping libgl1-mesa-glx reduces image size and potential OpenGL-related issues in headless environments 🚀
  • More reliable behavior: Clearer class-handling logic in YOLOE-11s avoids confusion and keeps behavior consistent whether users pass class names or not ✅
  • Maintenance win: Minor formatting improvements make CI configs and code easier to read and maintain 🧠

@UltralyticsAssistant UltralyticsAssistant added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 26, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @pderrenger, thank you for submitting an ultralytics/replicate 🚀 PR! This is an automated response — an Ultralytics engineer will review and assist soon. In the meantime, to ensure a seamless integration of your work, please review the following checklist:

  • Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • Synchronize with Source: Confirm your PR is synchronized with the ultralytics/replicate main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • Update Documentation: Update the relevant documentation for any new or modified features.
  • Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
  • Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

Noted highlights from your PR: improved initialization logic for YOLOE-11s, a corrected Replicate token link, and minor CI cleanup — great scope for readability and maintenance! 🔧✨

For more guidance, please refer to our Contributing Guide. Don’t hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher
Copy link
Member

@onuralpszr did a slight refactor and removed libgl1-mesa-glx here as seemed to be causing problems in the CI builds.

@glenn-jocher glenn-jocher merged commit a9e9d3c into main Aug 26, 2025
10 checks passed
@glenn-jocher glenn-jocher deleted the refactor-20250826202219 branch August 26, 2025 18:51
@UltralyticsAssistant
Copy link
Member

Merged — thank you, @pderrenger and @glenn-jocher! “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away.” — Antoine de Saint‑Exupéry. Your PR embodies this: trimming libgl1-mesa-glx, clarifying YOLOE-11s initialization in re_init_model, and tidying the matrix make Replicate builds leaner, faster, and more reliable in headless environments while improving readability. Big win for users and maintainers alike — appreciate the thoughtful craftsmanship and teamwork! 🚀👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants