🌟 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 inultralytics/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
- Adds a lightweight
-
🧠 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 atorch.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
- Switches to
-
🧠 Modern types + style cleanup
- Modern Python 3.10+ typing across modules (built-in generics, union
|
, postponed annotations). - PEP8/style refactors and minor test cleanups for clarity and safety.
- PRs: Modernize type hints by @onuralpszr, PEP8 refactor by @glenn-jocher, Whitespace cleanup by @onuralpszr
- Modern Python 3.10+ typing across modules (built-in generics, union
-
📘 Documentation improvements
- MkDocs config updated to consistently hide duplicate
__init__
summaries. - Fixes
autosplit
import path in guides (ultralytics.data.split.autosplit
). - Adds new reference page for
ultralytics.utils.git
. - PRs: Hide init summaries by @glenn-jocher, Fix autosplit import by @ambitious-octopus
- MkDocs config updated to consistently hide duplicate
-
🔖 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 atorch.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
- PEP8 refactor by @glenn-jocher in #21890
- Update mkdocs.yml to
ignore_init_summary
by @glenn-jocher in #21889 - chore: 🧹 clean up white-space across multiple files by @onuralpszr in #21893
- refactor(types): ♻️ modernize type hints with built-in generics and union syntax by @onuralpszr in #21891
- Fix Docs autosplit import by @ambitious-octopus in #21898
- Fix Autobackend string model bug by @glenn-jocher in #21892
ultralytics 8.3.191
Pure-pathlib Git metadata (no subprocess, ~200× faster) by @glenn-jocher in #21885
Full Changelog: v8.3.190...v8.3.191