ultralytics 8.3.27__tar.gz → 8.3.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ultralytics-8.3.27/ultralytics.egg-info → ultralytics-8.3.29}/PKG-INFO +4 -4
- {ultralytics-8.3.27 → ultralytics-8.3.29}/README.md +3 -3
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_exports.py +9 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/__init__.py +1 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/__init__.py +143 -3
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/default.yaml +1 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/annotator.py +15 -2
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/converter.py +5 -4
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/exporter.py +175 -8
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/model.py +2 -2
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/results.py +2 -2
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/trainer.py +1 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/autobackend.py +23 -4
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/block.py +2 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/head.py +9 -3
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/ai_gym.py +2 -4
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/solutions.py +18 -4
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/__init__.py +1 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/benchmarks.py +12 -3
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/comet.py +1 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/raytune.py +1 -2
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/instance.py +1 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/tal.py +1 -1
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/torch_utils.py +45 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29/ultralytics.egg-info}/PKG-INFO +4 -4
- {ultralytics-8.3.27 → ultralytics-8.3.29}/LICENSE +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/pyproject.toml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/setup.cfg +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/conftest.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_cli.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_cuda.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_engine.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_integrations.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_python.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/tests/test_solutions.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/assets/bus.jpg +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/assets/zidane.jpg +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/VOC.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco128.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/coco8.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/dota8.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/lvis.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/signature.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/datasets/xView.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/solutions/default.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/trackers/botsort.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/augment.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/base.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/build.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/dataset.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/loaders.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/split_dota.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/data/utils.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/predictor.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/tuner.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/engine/validator.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/hub/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/hub/auth.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/hub/google/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/hub/session.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/hub/utils.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/fastsam/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/fastsam/model.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/fastsam/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/fastsam/utils.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/fastsam/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/nas/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/nas/model.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/nas/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/nas/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/rtdetr/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/rtdetr/model.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/rtdetr/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/rtdetr/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/rtdetr/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/amg.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/build.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/model.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/blocks.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/decoders.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/encoders.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/memory_attention.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/sam.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/transformer.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/modules/utils.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/sam/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/utils/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/utils/loss.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/utils/ops.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/classify/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/classify/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/classify/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/classify/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/detect/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/detect/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/detect/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/detect/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/model.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/obb/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/obb/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/obb/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/obb/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/pose/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/pose/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/pose/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/pose/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/segment/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/segment/predict.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/segment/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/segment/val.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/world/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/world/train.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/models/yolo/world/train_world.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/activation.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/conv.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/transformer.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/modules/utils.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/nn/tasks.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/analytics.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/distance_calculation.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/heatmap.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/object_counter.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/parking_management.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/queue_management.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/speed_estimation.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/solutions/streamlit_inference.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/basetrack.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/bot_sort.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/byte_tracker.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/track.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/utils/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/utils/gmc.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/utils/kalman_filter.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/trackers/utils/matching.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/autobatch.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/__init__.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/base.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/clearml.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/dvc.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/hub.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/mlflow.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/neptune.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/tensorboard.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/callbacks/wb.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/checks.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/dist.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/downloads.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/errors.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/files.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/loss.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/metrics.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/ops.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/patches.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/plotting.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/triton.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics/utils/tuner.py +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics.egg-info/SOURCES.txt +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics.egg-info/dependency_links.txt +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics.egg-info/entry_points.txt +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics.egg-info/requires.txt +0 -0
- {ultralytics-8.3.27 → ultralytics-8.3.29}/ultralytics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.29
|
4
4
|
Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -96,8 +96,8 @@ Requires-Dist: pycocotools>=2.0.7; extra == "extra"
|
|
96
96
|
|
97
97
|
<div>
|
98
98
|
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
99
|
+
<a href="https://www.pepy.tech/projects/ultralytics"><img src="https://static.pepy.tech/badge/ultralytics" alt="Ultralytics Downloads"></a>
|
99
100
|
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="Ultralytics YOLO Citation"></a>
|
100
|
-
<a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Ultralytics Docker Pulls"></a>
|
101
101
|
<a href="https://discord.com/invite/ultralytics"><img alt="Ultralytics Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
102
102
|
<a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>
|
103
103
|
<a href="https://reddit.com/r/ultralytics"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
|
@@ -143,7 +143,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
|
|
143
143
|
|
144
144
|
Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
145
145
|
|
146
|
-
[](https://pypi.org/project/ultralytics/) [](https://pepy.tech/
|
146
|
+
[](https://pypi.org/project/ultralytics/) [](https://www.pepy.tech/projects/ultralytics) [](https://pypi.org/project/ultralytics/)
|
147
147
|
|
148
148
|
```bash
|
149
149
|
pip install ultralytics
|
@@ -151,7 +151,7 @@ pip install ultralytics
|
|
151
151
|
|
152
152
|
For alternative installation methods including [Conda](https://anaconda.org/conda-forge/ultralytics), [Docker](https://hub.docker.com/r/ultralytics/ultralytics), and Git, please refer to the [Quickstart Guide](https://docs.ultralytics.com/quickstart/).
|
153
153
|
|
154
|
-
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
154
|
+
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
155
155
|
|
156
156
|
</details>
|
157
157
|
|
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
<div>
|
10
10
|
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
11
|
+
<a href="https://www.pepy.tech/projects/ultralytics"><img src="https://static.pepy.tech/badge/ultralytics" alt="Ultralytics Downloads"></a>
|
11
12
|
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="Ultralytics YOLO Citation"></a>
|
12
|
-
<a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Ultralytics Docker Pulls"></a>
|
13
13
|
<a href="https://discord.com/invite/ultralytics"><img alt="Ultralytics Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
14
14
|
<a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>
|
15
15
|
<a href="https://reddit.com/r/ultralytics"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
|
@@ -55,7 +55,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
|
|
55
55
|
|
56
56
|
Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
57
57
|
|
58
|
-
[](https://pypi.org/project/ultralytics/) [](https://pepy.tech/
|
58
|
+
[](https://pypi.org/project/ultralytics/) [](https://www.pepy.tech/projects/ultralytics) [](https://pypi.org/project/ultralytics/)
|
59
59
|
|
60
60
|
```bash
|
61
61
|
pip install ultralytics
|
@@ -63,7 +63,7 @@ pip install ultralytics
|
|
63
63
|
|
64
64
|
For alternative installation methods including [Conda](https://anaconda.org/conda-forge/ultralytics), [Docker](https://hub.docker.com/r/ultralytics/ultralytics), and Git, please refer to the [Quickstart Guide](https://docs.ultralytics.com/quickstart/).
|
65
65
|
|
66
|
-
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
66
|
+
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
67
67
|
|
68
68
|
</details>
|
69
69
|
|
@@ -205,3 +205,12 @@ def test_export_ncnn():
|
|
205
205
|
"""Test YOLO exports to NCNN format."""
|
206
206
|
file = YOLO(MODEL).export(format="ncnn", imgsz=32)
|
207
207
|
YOLO(file)(SOURCE, imgsz=32) # exported model inference
|
208
|
+
|
209
|
+
|
210
|
+
@pytest.mark.skipif(True, reason="Test disabled as keras and tensorflow version conflicts with tflite export.")
|
211
|
+
@pytest.mark.skipif(not LINUX or MACOS, reason="Skipping test on Windows and Macos")
|
212
|
+
def test_export_imx():
|
213
|
+
"""Test YOLOv8n exports to IMX format."""
|
214
|
+
model = YOLO("yolov8n.pt")
|
215
|
+
file = model.export(format="imx", imgsz=32)
|
216
|
+
YOLO(file)(SOURCE, imgsz=32)
|
@@ -7,11 +7,15 @@ from pathlib import Path
|
|
7
7
|
from types import SimpleNamespace
|
8
8
|
from typing import Dict, List, Union
|
9
9
|
|
10
|
+
import cv2
|
11
|
+
|
10
12
|
from ultralytics.utils import (
|
11
13
|
ASSETS,
|
14
|
+
ASSETS_URL,
|
12
15
|
DEFAULT_CFG,
|
13
16
|
DEFAULT_CFG_DICT,
|
14
17
|
DEFAULT_CFG_PATH,
|
18
|
+
DEFAULT_SOL_DICT,
|
15
19
|
IS_VSCODE,
|
16
20
|
LOGGER,
|
17
21
|
RANK,
|
@@ -30,6 +34,17 @@ from ultralytics.utils import (
|
|
30
34
|
yaml_print,
|
31
35
|
)
|
32
36
|
|
37
|
+
# Define valid solutions
|
38
|
+
SOLUTION_MAP = {
|
39
|
+
"count": ("ObjectCounter", "count"),
|
40
|
+
"heatmap": ("Heatmap", "generate_heatmap"),
|
41
|
+
"queue": ("QueueManager", "process_queue"),
|
42
|
+
"speed": ("SpeedEstimator", "estimate_speed"),
|
43
|
+
"workout": ("AIGym", "monitor"),
|
44
|
+
"analytics": ("Analytics", "process_data"),
|
45
|
+
"help": None,
|
46
|
+
}
|
47
|
+
|
33
48
|
# Define valid tasks and modes
|
34
49
|
MODES = {"train", "val", "predict", "export", "track", "benchmark"}
|
35
50
|
TASKS = {"detect", "segment", "classify", "pose", "obb"}
|
@@ -57,6 +72,31 @@ TASK2METRIC = {
|
|
57
72
|
MODELS = {TASK2MODEL[task] for task in TASKS}
|
58
73
|
|
59
74
|
ARGV = sys.argv or ["", ""] # sometimes sys.argv = []
|
75
|
+
SOLUTIONS_HELP_MSG = f"""
|
76
|
+
Arguments received: {str(['yolo'] + ARGV[1:])}. Ultralytics 'yolo solutions' usage overview:
|
77
|
+
|
78
|
+
yolo SOLUTIONS SOLUTION ARGS
|
79
|
+
|
80
|
+
Where SOLUTIONS (required) is a keyword
|
81
|
+
SOLUTION (optional) is one of {list(SOLUTION_MAP.keys())}
|
82
|
+
ARGS (optional) are any number of custom 'arg=value' pairs like 'show_in=True' that override defaults.
|
83
|
+
See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
|
84
|
+
|
85
|
+
1. Call object counting solution
|
86
|
+
yolo solutions count source="path/to/video/file.mp4" region=[(20, 400), (1080, 404), (1080, 360), (20, 360)]
|
87
|
+
|
88
|
+
2. Call heatmaps solution
|
89
|
+
yolo solutions heatmap colormap=cv2.COLORMAP_PARAULA model=yolo11n.pt
|
90
|
+
|
91
|
+
3. Call queue management solution
|
92
|
+
yolo solutions queue region=[(20, 400), (1080, 404), (1080, 360), (20, 360)] model=yolo11n.pt
|
93
|
+
|
94
|
+
4. Call workouts monitoring solution for push-ups
|
95
|
+
yolo solutions workout model=yolo11n-pose.pt kpts=[6, 8, 10]
|
96
|
+
|
97
|
+
5. Generate analytical graphs
|
98
|
+
yolo solutions analytics analytics_type="pie"
|
99
|
+
"""
|
60
100
|
CLI_HELP_MSG = f"""
|
61
101
|
Arguments received: {str(['yolo'] + ARGV[1:])}. Ultralytics 'yolo' commands use the following syntax:
|
62
102
|
|
@@ -78,19 +118,24 @@ CLI_HELP_MSG = f"""
|
|
78
118
|
|
79
119
|
4. Export a YOLO11n classification model to ONNX format at image size 224 by 128 (no TASK required)
|
80
120
|
yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
|
81
|
-
|
121
|
+
|
82
122
|
5. Streamlit real-time webcam inference GUI
|
83
123
|
yolo streamlit-predict
|
84
|
-
|
85
|
-
6.
|
124
|
+
|
125
|
+
6. Ultralytics solutions usage
|
126
|
+
yolo solutions count or in {list(SOLUTION_MAP.keys())} source="path/to/video/file.mp4"
|
127
|
+
|
128
|
+
7. Run special commands:
|
86
129
|
yolo help
|
87
130
|
yolo checks
|
88
131
|
yolo version
|
89
132
|
yolo settings
|
90
133
|
yolo copy-cfg
|
91
134
|
yolo cfg
|
135
|
+
yolo solutions help
|
92
136
|
|
93
137
|
Docs: https://docs.ultralytics.com
|
138
|
+
Solutions: https://docs.ultralytics.com/solutions/
|
94
139
|
Community: https://community.ultralytics.com
|
95
140
|
GitHub: https://github.com/ultralytics/ultralytics
|
96
141
|
"""
|
@@ -568,6 +613,100 @@ def handle_yolo_settings(args: List[str]) -> None:
|
|
568
613
|
LOGGER.warning(f"WARNING ⚠️ settings error: '{e}'. Please see {url} for help.")
|
569
614
|
|
570
615
|
|
616
|
+
def handle_yolo_solutions(args: List[str]) -> None:
|
617
|
+
"""
|
618
|
+
Processes YOLO solutions arguments and runs the specified computer vision solutions pipeline.
|
619
|
+
|
620
|
+
Args:
|
621
|
+
args (List[str]): Command-line arguments for configuring and running the Ultralytics YOLO
|
622
|
+
solutions: https://docs.ultralytics.com/solutions/, It can include solution name, source,
|
623
|
+
and other configuration parameters.
|
624
|
+
|
625
|
+
Returns:
|
626
|
+
None: The function processes video frames and saves the output but doesn't return any value.
|
627
|
+
|
628
|
+
Examples:
|
629
|
+
Run people counting solution with default settings:
|
630
|
+
>>> handle_yolo_solutions(["count"])
|
631
|
+
|
632
|
+
Run analytics with custom configuration:
|
633
|
+
>>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video/file.mp4"])
|
634
|
+
|
635
|
+
Notes:
|
636
|
+
- Default configurations are merged from DEFAULT_SOL_DICT and DEFAULT_CFG_DICT
|
637
|
+
- Arguments can be provided in the format 'key=value' or as boolean flags
|
638
|
+
- Available solutions are defined in SOLUTION_MAP with their respective classes and methods
|
639
|
+
- If an invalid solution is provided, defaults to 'count' solution
|
640
|
+
- Output videos are saved in 'runs/solution/{solution_name}' directory
|
641
|
+
- For 'analytics' solution, frame numbers are tracked for generating analytical graphs
|
642
|
+
- Video processing can be interrupted by pressing 'q'
|
643
|
+
- Processes video frames sequentially and saves output in .avi format
|
644
|
+
- If no source is specified, downloads and uses a default sample video
|
645
|
+
"""
|
646
|
+
full_args_dict = {**DEFAULT_SOL_DICT, **DEFAULT_CFG_DICT} # arguments dictionary
|
647
|
+
overrides = {}
|
648
|
+
|
649
|
+
# check dictionary alignment
|
650
|
+
for arg in merge_equals_args(args):
|
651
|
+
arg = arg.lstrip("-").rstrip(",")
|
652
|
+
if "=" in arg:
|
653
|
+
try:
|
654
|
+
k, v = parse_key_value_pair(arg)
|
655
|
+
overrides[k] = v
|
656
|
+
except (NameError, SyntaxError, ValueError, AssertionError) as e:
|
657
|
+
check_dict_alignment(full_args_dict, {arg: ""}, e)
|
658
|
+
elif arg in full_args_dict and isinstance(full_args_dict.get(arg), bool):
|
659
|
+
overrides[arg] = True
|
660
|
+
check_dict_alignment(full_args_dict, overrides) # dict alignment
|
661
|
+
|
662
|
+
# Get solution name
|
663
|
+
if args and args[0] in SOLUTION_MAP:
|
664
|
+
if args[0] != "help":
|
665
|
+
s_n = args.pop(0) # Extract the solution name directly
|
666
|
+
else:
|
667
|
+
LOGGER.info(SOLUTIONS_HELP_MSG)
|
668
|
+
else:
|
669
|
+
LOGGER.warning(
|
670
|
+
f"⚠️ No valid solution provided. Using default 'count'. Available: {', '.join(SOLUTION_MAP.keys())}"
|
671
|
+
)
|
672
|
+
s_n = "count" # Default solution if none provided
|
673
|
+
|
674
|
+
cls, method = SOLUTION_MAP[s_n] # solution class name, method name and default source
|
675
|
+
|
676
|
+
from ultralytics import solutions # import ultralytics solutions
|
677
|
+
|
678
|
+
solution = getattr(solutions, cls)(IS_CLI=True, **overrides) # get solution class i.e ObjectCounter
|
679
|
+
process = getattr(solution, method) # get specific function of class for processing i.e, count from ObjectCounter
|
680
|
+
|
681
|
+
cap = cv2.VideoCapture(solution.CFG["source"]) # read the video file
|
682
|
+
|
683
|
+
# extract width, height and fps of the video file, create save directory and initialize video writer
|
684
|
+
import os # for directory creation
|
685
|
+
from pathlib import Path
|
686
|
+
|
687
|
+
from ultralytics.utils.files import increment_path # for output directory path update
|
688
|
+
|
689
|
+
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
|
690
|
+
if s_n == "analytics": # analytical graphs follow fixed shape for output i.e w=1920, h=1080
|
691
|
+
w, h = 1920, 1080
|
692
|
+
save_dir = increment_path(Path("runs") / "solutions" / "exp", exist_ok=False)
|
693
|
+
save_dir.mkdir(parents=True, exist_ok=True) # create the output directory
|
694
|
+
vw = cv2.VideoWriter(os.path.join(save_dir, "solution.avi"), cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
|
695
|
+
|
696
|
+
try: # Process video frames
|
697
|
+
f_n = 0 # frame number, required for analytical graphs
|
698
|
+
while cap.isOpened():
|
699
|
+
success, frame = cap.read()
|
700
|
+
if not success:
|
701
|
+
break
|
702
|
+
frame = process(frame, f_n := f_n + 1) if s_n == "analytics" else process(frame)
|
703
|
+
vw.write(frame)
|
704
|
+
if cv2.waitKey(1) & 0xFF == ord("q"):
|
705
|
+
break
|
706
|
+
finally:
|
707
|
+
cap.release()
|
708
|
+
|
709
|
+
|
571
710
|
def handle_streamlit_inference():
|
572
711
|
"""
|
573
712
|
Open the Ultralytics Live Inference Streamlit app for real-time object detection.
|
@@ -709,6 +848,7 @@ def entrypoint(debug=""):
|
|
709
848
|
"logout": lambda: handle_yolo_hub(args),
|
710
849
|
"copy-cfg": copy_default_cfg,
|
711
850
|
"streamlit-predict": lambda: handle_streamlit_inference(),
|
851
|
+
"solutions": lambda: handle_yolo_solutions(args[1:]),
|
712
852
|
}
|
713
853
|
full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
|
714
854
|
|
@@ -36,7 +36,7 @@ profile: False # (bool) profile ONNX and TensorRT speeds during training for log
|
|
36
36
|
freeze: None # (int | list, optional) freeze first n layers, or freeze list of layer indices during training
|
37
37
|
multi_scale: False # (bool) Whether to use multiscale during training
|
38
38
|
# Segmentation
|
39
|
-
overlap_mask: True # (bool) masks
|
39
|
+
overlap_mask: True # (bool) merge object masks into a single image mask during training (segment train only)
|
40
40
|
mask_ratio: 4 # (int) mask downsample ratio (segment train only)
|
41
41
|
# Classification
|
42
42
|
dropout: 0.0 # (float) use dropout regularization (classify train only)
|
@@ -6,7 +6,16 @@ from ultralytics import SAM, YOLO
|
|
6
6
|
|
7
7
|
|
8
8
|
def auto_annotate(
|
9
|
-
data,
|
9
|
+
data,
|
10
|
+
det_model="yolo11x.pt",
|
11
|
+
sam_model="sam_b.pt",
|
12
|
+
device="",
|
13
|
+
conf=0.25,
|
14
|
+
iou=0.45,
|
15
|
+
imgsz=640,
|
16
|
+
max_det=300,
|
17
|
+
classes=None,
|
18
|
+
output_dir=None,
|
10
19
|
):
|
11
20
|
"""
|
12
21
|
Automatically annotates images using a YOLO object detection model and a SAM segmentation model.
|
@@ -22,6 +31,8 @@ def auto_annotate(
|
|
22
31
|
conf (float): Confidence threshold for detection model; default is 0.25.
|
23
32
|
iou (float): IoU threshold for filtering overlapping boxes in detection results; default is 0.45.
|
24
33
|
imgsz (int): Input image resize dimension; default is 640.
|
34
|
+
max_det (int): Limits detections per image to control outputs in dense scenes.
|
35
|
+
classes (list): Filters predictions to specified class IDs, returning only relevant detections.
|
25
36
|
output_dir (str | None): Directory to save the annotated results. If None, a default directory is created.
|
26
37
|
|
27
38
|
Examples:
|
@@ -41,7 +52,9 @@ def auto_annotate(
|
|
41
52
|
output_dir = data.parent / f"{data.stem}_auto_annotate_labels"
|
42
53
|
Path(output_dir).mkdir(exist_ok=True, parents=True)
|
43
54
|
|
44
|
-
det_results = det_model(
|
55
|
+
det_results = det_model(
|
56
|
+
data, stream=True, device=device, conf=conf, iou=iou, imgsz=imgsz, max_det=max_det, classes=classes
|
57
|
+
)
|
45
58
|
|
46
59
|
for result in det_results:
|
47
60
|
class_ids = result.boxes.cls.int().tolist() # noqa
|
@@ -577,7 +577,7 @@ def merge_multi_segment(segments):
|
|
577
577
|
return s
|
578
578
|
|
579
579
|
|
580
|
-
def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"):
|
580
|
+
def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt", device=None):
|
581
581
|
"""
|
582
582
|
Converts existing object detection dataset (bounding boxes) to segmentation dataset or oriented bounding box (OBB)
|
583
583
|
in YOLO format. Generates segmentation data using SAM auto-annotator as needed.
|
@@ -587,6 +587,7 @@ def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"):
|
|
587
587
|
save_dir (str | Path): Path to save the generated labels, labels will be saved
|
588
588
|
into `labels-segment` in the same directory level of `im_dir` if save_dir is None. Default: None.
|
589
589
|
sam_model (str): Segmentation model to use for intermediate segmentation data; optional.
|
590
|
+
device (int | str): The specific device to run SAM models. Default: None.
|
590
591
|
|
591
592
|
Notes:
|
592
593
|
The input directory structure assumed for dataset:
|
@@ -621,7 +622,7 @@ def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"):
|
|
621
622
|
boxes[:, [0, 2]] *= w
|
622
623
|
boxes[:, [1, 3]] *= h
|
623
624
|
im = cv2.imread(label["im_file"])
|
624
|
-
sam_results = sam_model(im, bboxes=xywh2xyxy(boxes), verbose=False, save=False)
|
625
|
+
sam_results = sam_model(im, bboxes=xywh2xyxy(boxes), verbose=False, save=False, device=device)
|
625
626
|
label["segments"] = sam_results[0].masks.xyn
|
626
627
|
|
627
628
|
save_dir = Path(save_dir) if save_dir else Path(im_dir).parent / "labels-segment"
|
@@ -636,8 +637,8 @@ def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"):
|
|
636
637
|
continue
|
637
638
|
line = (int(cls[i]), *s.reshape(-1))
|
638
639
|
texts.append(("%g " * len(line)).rstrip() % line)
|
639
|
-
|
640
|
-
|
640
|
+
with open(txt_file, "a") as f:
|
641
|
+
f.writelines(text + "\n" for text in texts)
|
641
642
|
LOGGER.info(f"Generated segment labels saved in {save_dir}")
|
642
643
|
|
643
644
|
|
@@ -18,6 +18,7 @@ TensorFlow.js | `tfjs` | yolo11n_web_model/
|
|
18
18
|
PaddlePaddle | `paddle` | yolo11n_paddle_model/
|
19
19
|
MNN | `mnn` | yolo11n.mnn
|
20
20
|
NCNN | `ncnn` | yolo11n_ncnn_model/
|
21
|
+
IMX | `imx` | yolo11n_imx_model/
|
21
22
|
|
22
23
|
Requirements:
|
23
24
|
$ pip install "ultralytics[export]"
|
@@ -44,6 +45,7 @@ Inference:
|
|
44
45
|
yolo11n_paddle_model # PaddlePaddle
|
45
46
|
yolo11n.mnn # MNN
|
46
47
|
yolo11n_ncnn_model # NCNN
|
48
|
+
yolo11n_imx_model # IMX
|
47
49
|
|
48
50
|
TensorFlow.js:
|
49
51
|
$ cd .. && git clone https://github.com/zldrobit/tfjs-yolov5-example.git && cd tfjs-yolov5-example
|
@@ -94,7 +96,7 @@ from ultralytics.utils.checks import check_imgsz, check_is_path_safe, check_requ
|
|
94
96
|
from ultralytics.utils.downloads import attempt_download_asset, get_github_assets, safe_download
|
95
97
|
from ultralytics.utils.files import file_size, spaces_in_path
|
96
98
|
from ultralytics.utils.ops import Profile
|
97
|
-
from ultralytics.utils.torch_utils import TORCH_1_13, get_latest_opset, select_device
|
99
|
+
from ultralytics.utils.torch_utils import TORCH_1_13, get_latest_opset, select_device
|
98
100
|
|
99
101
|
|
100
102
|
def export_formats():
|
@@ -114,6 +116,7 @@ def export_formats():
|
|
114
116
|
["PaddlePaddle", "paddle", "_paddle_model", True, True],
|
115
117
|
["MNN", "mnn", ".mnn", True, True],
|
116
118
|
["NCNN", "ncnn", "_ncnn_model", True, True],
|
119
|
+
["IMX", "imx", "_imx_model", True, True],
|
117
120
|
]
|
118
121
|
return dict(zip(["Format", "Argument", "Suffix", "CPU", "GPU"], zip(*x)))
|
119
122
|
|
@@ -171,7 +174,6 @@ class Exporter:
|
|
171
174
|
self.callbacks = _callbacks or callbacks.get_default_callbacks()
|
172
175
|
callbacks.add_integration_callbacks(self)
|
173
176
|
|
174
|
-
@smart_inference_mode()
|
175
177
|
def __call__(self, model=None) -> str:
|
176
178
|
"""Returns list of exported files/dirs after running callbacks."""
|
177
179
|
self.run_callbacks("on_export_start")
|
@@ -194,9 +196,22 @@ class Exporter:
|
|
194
196
|
flags = [x == fmt for x in fmts]
|
195
197
|
if sum(flags) != 1:
|
196
198
|
raise ValueError(f"Invalid export format='{fmt}'. Valid formats are {fmts}")
|
197
|
-
|
198
|
-
|
199
|
-
|
199
|
+
(
|
200
|
+
jit,
|
201
|
+
onnx,
|
202
|
+
xml,
|
203
|
+
engine,
|
204
|
+
coreml,
|
205
|
+
saved_model,
|
206
|
+
pb,
|
207
|
+
tflite,
|
208
|
+
edgetpu,
|
209
|
+
tfjs,
|
210
|
+
paddle,
|
211
|
+
mnn,
|
212
|
+
ncnn,
|
213
|
+
imx,
|
214
|
+
) = flags # export booleans
|
200
215
|
is_tf_format = any((saved_model, pb, tflite, edgetpu, tfjs))
|
201
216
|
|
202
217
|
# Device
|
@@ -210,6 +225,9 @@ class Exporter:
|
|
210
225
|
self.device = select_device("cpu" if self.args.device is None else self.args.device)
|
211
226
|
|
212
227
|
# Checks
|
228
|
+
if imx and not self.args.int8:
|
229
|
+
LOGGER.warning("WARNING ⚠️ IMX only supports int8 export, setting int8=True.")
|
230
|
+
self.args.int8 = True
|
213
231
|
if not hasattr(model, "names"):
|
214
232
|
model.names = default_class_names()
|
215
233
|
model.names = check_class_names(model.names)
|
@@ -226,6 +244,8 @@ class Exporter:
|
|
226
244
|
if self.args.optimize:
|
227
245
|
assert not ncnn, "optimize=True not compatible with format='ncnn', i.e. use optimize=False"
|
228
246
|
assert self.device.type == "cpu", "optimize=True not compatible with cuda devices, i.e. use device='cpu'"
|
247
|
+
if self.args.int8 and tflite:
|
248
|
+
assert not getattr(model, "end2end", False), "TFLite INT8 export not supported for end2end models."
|
229
249
|
if edgetpu:
|
230
250
|
if not LINUX:
|
231
251
|
raise SystemError("Edge TPU export only supported on Linux. See https://coral.ai/docs/edgetpu/compiler")
|
@@ -247,6 +267,7 @@ class Exporter:
|
|
247
267
|
)
|
248
268
|
if mnn and (IS_RASPBERRYPI or IS_JETSON):
|
249
269
|
raise SystemError("MNN export not supported on Raspberry Pi and NVIDIA Jetson")
|
270
|
+
|
250
271
|
# Input
|
251
272
|
im = torch.zeros(self.args.batch, 3, *self.imgsz).to(self.device)
|
252
273
|
file = Path(
|
@@ -262,6 +283,11 @@ class Exporter:
|
|
262
283
|
model.eval()
|
263
284
|
model.float()
|
264
285
|
model = model.fuse()
|
286
|
+
|
287
|
+
if imx:
|
288
|
+
from ultralytics.utils.torch_utils import FXModel
|
289
|
+
|
290
|
+
model = FXModel(model)
|
265
291
|
for m in model.modules():
|
266
292
|
if isinstance(m, (Detect, RTDETRDecoder)): # includes all Detect subclasses like Segment, Pose, OBB
|
267
293
|
m.dynamic = self.args.dynamic
|
@@ -271,6 +297,15 @@ class Exporter:
|
|
271
297
|
elif isinstance(m, C2f) and not is_tf_format:
|
272
298
|
# EdgeTPU does not support FlexSplitV while split provides cleaner ONNX graph
|
273
299
|
m.forward = m.forward_split
|
300
|
+
if isinstance(m, Detect) and imx:
|
301
|
+
from ultralytics.utils.tal import make_anchors
|
302
|
+
|
303
|
+
m.anchors, m.strides = (
|
304
|
+
x.transpose(0, 1)
|
305
|
+
for x in make_anchors(
|
306
|
+
torch.cat([s / m.stride.unsqueeze(-1) for s in self.imgsz], dim=1), m.stride, 0.5
|
307
|
+
)
|
308
|
+
)
|
274
309
|
|
275
310
|
y = None
|
276
311
|
for _ in range(2):
|
@@ -345,6 +380,8 @@ class Exporter:
|
|
345
380
|
f[11], _ = self.export_mnn()
|
346
381
|
if ncnn: # NCNN
|
347
382
|
f[12], _ = self.export_ncnn()
|
383
|
+
if imx:
|
384
|
+
f[13], _ = self.export_imx()
|
348
385
|
|
349
386
|
# Finish
|
350
387
|
f = [str(x) for x in f if x] # filter out '' and None
|
@@ -566,8 +603,7 @@ class Exporter:
|
|
566
603
|
f = str(self.file.with_suffix(".mnn")) # MNN model file
|
567
604
|
args = ["", "-f", "ONNX", "--modelFile", f_onnx, "--MNNModel", f, "--bizCode", json.dumps(self.metadata)]
|
568
605
|
if self.args.int8:
|
569
|
-
args.
|
570
|
-
args.append("8")
|
606
|
+
args.extend(("--weightQuantBits", "8"))
|
571
607
|
if self.args.half:
|
572
608
|
args.append("--fp16")
|
573
609
|
mnnconvert.convert(args)
|
@@ -791,7 +827,7 @@ class Exporter:
|
|
791
827
|
LOGGER.warning(f"{prefix} WARNING ⚠️ 'dynamic=True' model requires max batch size, i.e. 'batch=16'")
|
792
828
|
profile = builder.create_optimization_profile()
|
793
829
|
min_shape = (1, shape[1], 32, 32) # minimum input shape
|
794
|
-
max_shape = (*shape[:2], *(max(1, self.args.workspace) * d for d in shape[2:])) # max input shape
|
830
|
+
max_shape = (*shape[:2], *(int(max(1, self.args.workspace) * d) for d in shape[2:])) # max input shape
|
795
831
|
for inp in inputs:
|
796
832
|
profile.set_shape(inp.name, min=min_shape, opt=shape, max=max_shape)
|
797
833
|
config.add_optimization_profile(profile)
|
@@ -1067,6 +1103,137 @@ class Exporter:
|
|
1067
1103
|
yaml_save(Path(f) / "metadata.yaml", self.metadata) # add metadata.yaml
|
1068
1104
|
return f, None
|
1069
1105
|
|
1106
|
+
@try_export
|
1107
|
+
def export_imx(self, prefix=colorstr("IMX:")):
|
1108
|
+
"""YOLO IMX export."""
|
1109
|
+
gptq = False
|
1110
|
+
assert LINUX, "export only supported on Linux. See https://developer.aitrios.sony-semicon.com/en/raspberrypi-ai-camera/documentation/imx500-converter"
|
1111
|
+
if getattr(self.model, "end2end", False):
|
1112
|
+
raise ValueError("IMX export is not supported for end2end models.")
|
1113
|
+
if "C2f" not in self.model.__str__():
|
1114
|
+
raise ValueError("IMX export is only supported for YOLOv8 detection models")
|
1115
|
+
check_requirements(("model-compression-toolkit==2.1.1", "sony-custom-layers==0.2.0", "tensorflow==2.12.0"))
|
1116
|
+
check_requirements("imx500-converter[pt]==3.14.3") # Separate requirements for imx500-converter
|
1117
|
+
|
1118
|
+
import model_compression_toolkit as mct
|
1119
|
+
import onnx
|
1120
|
+
from sony_custom_layers.pytorch.object_detection.nms import multiclass_nms
|
1121
|
+
|
1122
|
+
try:
|
1123
|
+
out = subprocess.run(
|
1124
|
+
["java", "--version"], check=True, capture_output=True
|
1125
|
+
) # Java 17 is required for imx500-converter
|
1126
|
+
if "openjdk 17" not in str(out.stdout):
|
1127
|
+
raise FileNotFoundError
|
1128
|
+
except FileNotFoundError:
|
1129
|
+
subprocess.run(["sudo", "apt", "install", "-y", "openjdk-17-jdk", "openjdk-17-jre"], check=True)
|
1130
|
+
|
1131
|
+
def representative_dataset_gen(dataloader=self.get_int8_calibration_dataloader(prefix)):
|
1132
|
+
for batch in dataloader:
|
1133
|
+
img = batch["img"]
|
1134
|
+
img = img / 255.0
|
1135
|
+
yield [img]
|
1136
|
+
|
1137
|
+
tpc = mct.get_target_platform_capabilities(
|
1138
|
+
fw_name="pytorch", target_platform_name="imx500", target_platform_version="v1"
|
1139
|
+
)
|
1140
|
+
|
1141
|
+
config = mct.core.CoreConfig(
|
1142
|
+
mixed_precision_config=mct.core.MixedPrecisionQuantizationConfig(num_of_images=10),
|
1143
|
+
quantization_config=mct.core.QuantizationConfig(concat_threshold_update=True),
|
1144
|
+
)
|
1145
|
+
|
1146
|
+
resource_utilization = mct.core.ResourceUtilization(weights_memory=3146176 * 0.76)
|
1147
|
+
|
1148
|
+
quant_model = (
|
1149
|
+
mct.gptq.pytorch_gradient_post_training_quantization( # Perform Gradient-Based Post Training Quantization
|
1150
|
+
model=self.model,
|
1151
|
+
representative_data_gen=representative_dataset_gen,
|
1152
|
+
target_resource_utilization=resource_utilization,
|
1153
|
+
gptq_config=mct.gptq.get_pytorch_gptq_config(n_epochs=1000, use_hessian_based_weights=False),
|
1154
|
+
core_config=config,
|
1155
|
+
target_platform_capabilities=tpc,
|
1156
|
+
)[0]
|
1157
|
+
if gptq
|
1158
|
+
else mct.ptq.pytorch_post_training_quantization( # Perform post training quantization
|
1159
|
+
in_module=self.model,
|
1160
|
+
representative_data_gen=representative_dataset_gen,
|
1161
|
+
target_resource_utilization=resource_utilization,
|
1162
|
+
core_config=config,
|
1163
|
+
target_platform_capabilities=tpc,
|
1164
|
+
)[0]
|
1165
|
+
)
|
1166
|
+
|
1167
|
+
class NMSWrapper(torch.nn.Module):
|
1168
|
+
def __init__(
|
1169
|
+
self,
|
1170
|
+
model: torch.nn.Module,
|
1171
|
+
score_threshold: float = 0.001,
|
1172
|
+
iou_threshold: float = 0.7,
|
1173
|
+
max_detections: int = 300,
|
1174
|
+
):
|
1175
|
+
"""
|
1176
|
+
Wrapping PyTorch Module with multiclass_nms layer from sony_custom_layers.
|
1177
|
+
|
1178
|
+
Args:
|
1179
|
+
model (nn.Module): Model instance.
|
1180
|
+
score_threshold (float): Score threshold for non-maximum suppression.
|
1181
|
+
iou_threshold (float): Intersection over union threshold for non-maximum suppression.
|
1182
|
+
max_detections (float): The number of detections to return.
|
1183
|
+
"""
|
1184
|
+
super().__init__()
|
1185
|
+
self.model = model
|
1186
|
+
self.score_threshold = score_threshold
|
1187
|
+
self.iou_threshold = iou_threshold
|
1188
|
+
self.max_detections = max_detections
|
1189
|
+
|
1190
|
+
def forward(self, images):
|
1191
|
+
# model inference
|
1192
|
+
outputs = self.model(images)
|
1193
|
+
|
1194
|
+
boxes = outputs[0]
|
1195
|
+
scores = outputs[1]
|
1196
|
+
nms = multiclass_nms(
|
1197
|
+
boxes=boxes,
|
1198
|
+
scores=scores,
|
1199
|
+
score_threshold=self.score_threshold,
|
1200
|
+
iou_threshold=self.iou_threshold,
|
1201
|
+
max_detections=self.max_detections,
|
1202
|
+
)
|
1203
|
+
return nms
|
1204
|
+
|
1205
|
+
quant_model = NMSWrapper(
|
1206
|
+
model=quant_model,
|
1207
|
+
score_threshold=self.args.conf or 0.001,
|
1208
|
+
iou_threshold=self.args.iou,
|
1209
|
+
max_detections=self.args.max_det,
|
1210
|
+
).to(self.device)
|
1211
|
+
|
1212
|
+
f = Path(str(self.file).replace(self.file.suffix, "_imx_model"))
|
1213
|
+
f.mkdir(exist_ok=True)
|
1214
|
+
onnx_model = f / Path(str(self.file).replace(self.file.suffix, "_imx.onnx")) # js dir
|
1215
|
+
mct.exporter.pytorch_export_model(
|
1216
|
+
model=quant_model, save_model_path=onnx_model, repr_dataset=representative_dataset_gen
|
1217
|
+
)
|
1218
|
+
|
1219
|
+
model_onnx = onnx.load(onnx_model) # load onnx model
|
1220
|
+
for k, v in self.metadata.items():
|
1221
|
+
meta = model_onnx.metadata_props.add()
|
1222
|
+
meta.key, meta.value = k, str(v)
|
1223
|
+
|
1224
|
+
onnx.save(model_onnx, onnx_model)
|
1225
|
+
|
1226
|
+
subprocess.run(
|
1227
|
+
["imxconv-pt", "-i", str(onnx_model), "-o", str(f), "--no-input-persistency", "--overwrite-output"],
|
1228
|
+
check=True,
|
1229
|
+
)
|
1230
|
+
|
1231
|
+
# Needed for imx models.
|
1232
|
+
with open(f / "labels.txt", "w") as file:
|
1233
|
+
file.writelines([f"{name}\n" for _, name in self.model.names.items()])
|
1234
|
+
|
1235
|
+
return f, None
|
1236
|
+
|
1070
1237
|
def _add_tflite_metadata(self, file):
|
1071
1238
|
"""Add metadata to *.tflite models per https://www.tensorflow.org/lite/models/convert/metadata."""
|
1072
1239
|
import flatbuffers
|