Muhammad Rizwan Munawar 8f7fe171f0
ultralytics 8.3.199 3% Faster Ultralytics Imports with Lazy Model Loading (#21985)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2025-09-12 14:02:57 +02:00

880 B

description keywords
Learn how Ultralytics uses lazy imports with __getattr__ to speed up package startup and load model classes like YOLO, NAS, RTDETR, and SAM only when needed. Ultralytics, YOLO, lazy import, __getattr__, NAS, RTDETR, SAM, FastSAM, YOLOWorld, performance, startup time, optimization

Reference for ultralytics/__init__.py

!!! note

This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/\_\_init\_\_.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/__init__.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/__init__.py) 🛠️. Thank you 🙏!

::: ultralytics.getattr





::: ultralytics.dir