pypi ultralytics 8.3.191
v8.3.191 - `ultralytics 8.3.191` Pure-pathlib Git metadata (no subprocess, ~200× faster) (#21885)

3 hours ago

🌟 Summary

v8.3.191 makes Git metadata access blazing fast and more reliable, simplifies model-loading internals, and polishes docs, types, and tests—resulting in a snappier, cleaner developer experience. ⚡🧹

📊 Key Changes

  • ⚡ Pure-pathlib Git metadata (no subprocess)

    • Adds a lightweight GitRepo utility in ultralytics/utils/git.py to read branch, commit, and origin directly from the filesystem (incl. worktrees and packed-refs).
    • Caches values and provides a simple script-mode output.
    • New docs page: Reference for utils/git.
    • Replaces legacy git helpers across the codebase (e.g., trainer metadata now uses the new GIT object).
    • PR: Pure-pathlib Git metadata (~200× faster) by @glenn-jocher
  • 🧠 AutoBackend/model-loading refinements

    • Switches to attempt_load_one_weight for cleaner single-weight loading and clearer APIs.
    • Removes support for list[str] weights in AutoBackend; pass a single path or a torch.nn.Module.
    • Clarifies TF.js backend message: “Ultralytics TF.js inference is not currently supported.”
    • PR: Fix Autobackend string model bug / refactor loading by @glenn-jocher
  • 🧠 Modern types + style cleanup

  • 📘 Documentation improvements

  • 🔖 Version bump

    • __version__ = "8.3.191"

Minimal example for the new Git utility:

from ultralytics.utils.git import GitRepo

g = GitRepo()  # auto-resolves repo root
if g.is_repo:
    print("Branch:", g.branch)
    print("Commit:", g.commit)
    print("Origin:", g.origin)

🎯 Purpose & Impact

  • Speed & reliability 🚀
    • Git info retrieval is now ~200× faster and more robust (no shelling out to git), improving startup and metadata reporting—especially in constrained or non-git environments.
  • Cleaner APIs & fewer footguns 🧼
    • Model-loading is simpler and more predictable. Single-source-of-truth loader removes ambiguity and clarifies unsupported backends (e.g., TF.js).
    • Note: If you previously passed list[str] weights to AutoBackend, switch to one model path or load a torch.nn.Module.
  • Better dev ergonomics 🧑‍💻
    • Modern typing and style refactors enhance readability, IDE assistance, and tooling.
    • Docs fixes remove duplication, ensure correct imports, and add a reference for the new Git utility.
  • No impact to YOLO11/YOLO12 training defaults 📦
    • Core training/inference behavior remains unchanged for common workflows; updates are backward compatible except for the noted model-list change in AutoBackend.

What's Changed

Full Changelog: v8.3.190...v8.3.191

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.