pypi ultralytics 8.3.190
v8.3.190 - `ultralytics 8.3.190` Autobackend `torch`-native NMS (#21862)

latest release: 8.3.191
one day ago

🌟 Summary

ultralytics 8.3.190 delivers a faster, torchvision-free NMS pipeline powered by a new PyTorch-native implementation optimized for YOLO11, plus stability and UX upgrades across CoreML, progress bars, macOS handling, and reproducibility. πŸš€

πŸ“Š Key Changes

  • Autobackend torch-native NMS (most important)

    • Introduces a new NMS module ultralytics/utils/nms.py with:
      • TorchNMS.nms (exact-match, optimized NMS) and TorchNMS.fast_nms (vectorized FastNMS)
      • non_max_suppression refactored here; rotated NMS supported via fast_nms + batch_probiou
    • Removes hard dependency on torchvision.ops.nms for prediction-time use
    • YOLO11-optimized, works on CPU and GPU, improves post-processing latency ⚑
    • Updated imports across the codebase (predict, val, examples) to from ultralytics.utils import nms
    • OBB flows and exporter now use TorchNMS.fast_nms with batch_probiou for rotated boxes
  • AutoBackend API cleanup

    • Renamed parameter weights= to model= for consistency and to avoid duplicate memory usage (@glenn-jocher)
    • Unified handling for in-memory torch.nn.Module and .pt loading; gradients disabled by default for safer, faster inference
    • Adds clear CoreML logging and a version gate
  • CoreML stability

    • Enforces coremltools>=8.0 for CoreML inference to prevent runtime issues; shows a helpful message before loading
  • Performance and stability

    • Reintroduces platform-safe in-place ops (sigmoid_(), clamp_()) for non-macOS 14 systems to boost speed
    • Adds MACOS14/NOT_MACOS14 flags to handle Apple MPS quirks safely
    • Faster internet checks using DNS lookups, improving startup reliability
  • Import-time and CI improvements

    • Scopes heavy imports (requests/psutil) to runtime, reducing import overhead and avoiding circular deps, including Ultralytics HUB utils
    • CI workflows now run for PRs targeting any branch, not just main
  • Geometric ops robustness

    • Refactors core ops to better handle both HW and HWC shapes, clarifies padding logic, and reduces redundant indexing
  • Reproducibility

    • Trainer saves git_commit in checkpoints; new utils.get_git_commit() with caching
  • UX and docs

    • TQDM progress bar now shows ETA, stable rate, cleaner units, and improved final-state display ⏳
    • Dataset/scripts/docs switch to subprocess.run(...) for safer command execution
    • Tutorial notebook updated for latest versions and simpler dataset download APIs

🎯 Purpose & Impact

  • Faster, leaner inference πŸƒβ€β™‚οΈπŸ’¨

    • PyTorch-native NMS reduces reliance on torchvision, speeds up post-processing, and lowers latency, especially helpful in deployment and environments where torchvision is heavy or unavailable.
  • Better platform reliability πŸ›‘οΈ

    • macOS 14 handling prevents MPS-related crashes with in-place ops.
    • CoreML gating avoids version pitfalls and smooths model execution on Apple devices.
  • Improved developer experience πŸ‘©β€πŸ’»

    • Cleaner AutoBackend(model=...) API, unified PyTorch paths, and no-grad defaults reduce boilerplate and risks.
    • Progress bar is more informative with ETA and better formatting.
  • Stronger reproducibility and CI coverage πŸ“¦

    • Git commit embedded in checkpoints makes experiments traceable.
    • CI runs for all PR branches, speeding up feedback across workflows.
  • Faster startup and β€œjust works” behavior βš™οΈ

    • Scoped imports and DNS-based connectivity checks improve responsiveness and robustness.

Quick usage examples:

  • Use the new NMS utilities:
    from ultralytics.utils import nms
    
    # preds: [B, C+4(+M), N]
    out = nms.non_max_suppression(preds, conf_thres=0.25, iou_thres=0.45)
  • Updated AutoBackend parameter:
    from ultralytics.nn.autobackend import AutoBackend
    
    model = AutoBackend(model="yolo11n.pt", device="cuda")
  • Ensure CoreML tools are up-to-date:
    pip install -U "coremltools>=8.0"
    

What's Changed

New Contributors

Full Changelog: v8.3.189...v8.3.190

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.