ultralytics 8.3.115__tar.gz → 8.3.116__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.115/ultralytics.egg-info → ultralytics-8.3.116}/PKG-INFO +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_python.py +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/__init__.py +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/augment.py +5 -7
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/base.py +3 -3
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/build.py +6 -7
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/dataset.py +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/utils.py +1 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/exporter.py +3 -7
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/results.py +5 -5
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/utils.py +4 -6
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/utils/loss.py +14 -3
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/model.py +4 -4
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/segment/predict.py +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/conv.py +4 -6
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/head.py +6 -4
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/ai_gym.py +7 -6
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/distance_calculation.py +2 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/object_blurrer.py +4 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/object_counter.py +2 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/queue_management.py +2 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/region_counter.py +2 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/solutions.py +24 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/speed_estimation.py +6 -3
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/trackzone.py +4 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/vision_eye.py +2 -2
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/checks.py +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/loss.py +23 -11
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/ops.py +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116/ultralytics.egg-info}/PKG-INFO +1 -1
- {ultralytics-8.3.115 → ultralytics-8.3.116}/LICENSE +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/README.md +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/pyproject.toml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/setup.cfg +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_cli.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_cuda.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_engine.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_exports.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_integrations.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/tests/test_solutions.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/assets/bus.jpg +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/assets/zidane.jpg +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/VOC.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco128.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco8-multispectral.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/coco8.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/dog-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/dota8-multispectral.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/dota8.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/lvis.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/medical-pills.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/signature.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/datasets/xView.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/default.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yoloe-11-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/11/yoloe-11.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/12/yolo12-cls.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/12/yolo12-obb.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/12/yolo12-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/12/yolo12-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/12/yolo12.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yoloe-v8-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yoloe-v8.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/solutions/default.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/trackers/botsort.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/annotator.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/converter.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/loaders.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/scripts/download_weights.sh +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/scripts/get_coco.sh +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/scripts/get_coco128.sh +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/scripts/get_imagenet.sh +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/split.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/data/split_dota.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/model.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/predictor.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/trainer.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/tuner.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/engine/validator.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/hub/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/hub/auth.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/hub/google/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/hub/session.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/hub/utils.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/fastsam/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/fastsam/model.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/fastsam/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/fastsam/utils.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/fastsam/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/nas/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/nas/model.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/nas/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/nas/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/rtdetr/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/rtdetr/model.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/rtdetr/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/rtdetr/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/rtdetr/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/amg.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/build.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/model.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/blocks.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/decoders.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/encoders.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/memory_attention.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/sam.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/modules/transformer.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/sam/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/utils/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/utils/ops.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/classify/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/classify/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/classify/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/classify/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/detect/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/detect/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/detect/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/detect/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/obb/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/obb/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/obb/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/obb/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/pose/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/pose/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/pose/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/pose/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/segment/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/segment/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/segment/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/world/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/world/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/world/train_world.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/yoloe/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/yoloe/predict.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/yoloe/train.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/yoloe/train_seg.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/models/yolo/yoloe/val.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/autobackend.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/activation.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/block.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/transformer.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/modules/utils.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/tasks.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/nn/text_model.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/analytics.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/heatmap.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/instance_segmentation.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/object_cropper.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/parking_management.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/security_alarm.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/solutions/streamlit_inference.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/basetrack.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/bot_sort.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/byte_tracker.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/track.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/utils/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/utils/gmc.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/utils/kalman_filter.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/trackers/utils/matching.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/autobatch.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/benchmarks.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/__init__.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/base.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/clearml.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/comet.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/dvc.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/hub.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/mlflow.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/neptune.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/raytune.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/tensorboard.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/callbacks/wb.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/dist.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/downloads.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/errors.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/export.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/files.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/instance.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/metrics.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/patches.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/plotting.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/tal.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/torch_utils.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/triton.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics/utils/tuner.py +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics.egg-info/SOURCES.txt +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics.egg-info/dependency_links.txt +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics.egg-info/entry_points.txt +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics.egg-info/requires.txt +0 -0
- {ultralytics-8.3.115 → ultralytics-8.3.116}/ultralytics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.116
|
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>
|
@@ -128,7 +128,7 @@ def test_predict_img(model_name):
|
|
128
128
|
Image.open(SOURCE), # PIL
|
129
129
|
np.zeros((320, 640, 3), dtype=np.uint8), # numpy
|
130
130
|
]
|
131
|
-
assert len(model(batch, imgsz=32)) == len(batch) # multiple sources in a batch
|
131
|
+
assert len(model(batch, imgsz=32, classes=0)) == len(batch) # multiple sources in a batch
|
132
132
|
|
133
133
|
|
134
134
|
@pytest.mark.parametrize("model", MODELS)
|
@@ -1027,10 +1027,9 @@ class RandomPerspective:
|
|
1027
1027
|
border (Tuple[int, int]): Border dimensions for the transformed image.
|
1028
1028
|
|
1029
1029
|
Returns:
|
1030
|
-
(
|
1031
|
-
|
1032
|
-
|
1033
|
-
- float: Scale factor applied during the transformation.
|
1030
|
+
img (np.ndarray): Transformed image.
|
1031
|
+
M (np.ndarray): 3x3 transformation matrix.
|
1032
|
+
s (float): Scale factor applied during the transformation.
|
1034
1033
|
|
1035
1034
|
Examples:
|
1036
1035
|
>>> import numpy as np
|
@@ -1124,9 +1123,8 @@ class RandomPerspective:
|
|
1124
1123
|
M (np.ndarray): Affine transformation matrix with shape (3, 3).
|
1125
1124
|
|
1126
1125
|
Returns:
|
1127
|
-
(
|
1128
|
-
|
1129
|
-
- Transformed and clipped segments with shape (N, M, 2).
|
1126
|
+
bboxes (np.ndarray): New bounding boxes with shape (N, 4) in xyxy format.
|
1127
|
+
segments (np.ndarray): Transformed and clipped segments with shape (N, M, 2).
|
1130
1128
|
|
1131
1129
|
Examples:
|
1132
1130
|
>>> segments = np.random.rand(10, 500, 2) # 10 segments with 500 points each
|
@@ -208,9 +208,9 @@ class BaseDataset(Dataset):
|
|
208
208
|
rect_mode (bool, optional): Whether to use rectangular resizing.
|
209
209
|
|
210
210
|
Returns:
|
211
|
-
(np.ndarray): Loaded image.
|
212
|
-
(
|
213
|
-
(
|
211
|
+
(np.ndarray): Loaded image as a NumPy array.
|
212
|
+
(Tuple[int, int]): Original image dimensions in (height, width) format.
|
213
|
+
(Tuple[int, int]): Resized image dimensions in (height, width) format.
|
214
214
|
|
215
215
|
Raises:
|
216
216
|
FileNotFoundError: If the image file is not found.
|
@@ -187,13 +187,12 @@ def check_source(source):
|
|
187
187
|
source (str | int | Path | List | Tuple | np.ndarray | PIL.Image | torch.Tensor): The input source to check.
|
188
188
|
|
189
189
|
Returns:
|
190
|
-
(
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
- tensor (bool): Whether the source is a torch.Tensor.
|
190
|
+
source (str | int | Path | List | Tuple | np.ndarray | PIL.Image | torch.Tensor): The processed source.
|
191
|
+
webcam (bool): Whether the source is a webcam.
|
192
|
+
screenshot (bool): Whether the source is a screenshot.
|
193
|
+
from_img (bool): Whether the source is an image or list of images.
|
194
|
+
in_memory (bool): Whether the source is an in-memory object.
|
195
|
+
tensor (bool): Whether the source is a torch.Tensor.
|
197
196
|
|
198
197
|
Raises:
|
199
198
|
TypeError: If the source type is unsupported.
|
@@ -386,7 +386,7 @@ class YOLOMultiModalDataset(YOLODataset):
|
|
386
386
|
Return category names for the dataset.
|
387
387
|
|
388
388
|
Returns:
|
389
|
-
(
|
389
|
+
(Set[str]): List of class names.
|
390
390
|
"""
|
391
391
|
names = self.data["names"].values()
|
392
392
|
return {n.strip() for name in names for n in name.split("/")} # category names
|
@@ -483,6 +483,7 @@ def check_cls_dataset(dataset, split=""):
|
|
483
483
|
|
484
484
|
Returns:
|
485
485
|
(dict): A dictionary containing the following keys:
|
486
|
+
|
486
487
|
- 'train' (Path): The directory path containing the training set of the dataset.
|
487
488
|
- 'val' (Path): The directory path containing the validation set of the dataset.
|
488
489
|
- 'test' (Path): The directory path containing the test set of the dataset.
|
@@ -105,7 +105,7 @@ from ultralytics.utils.checks import (
|
|
105
105
|
from ultralytics.utils.downloads import attempt_download_asset, get_github_assets, safe_download
|
106
106
|
from ultralytics.utils.export import export_engine, export_onnx
|
107
107
|
from ultralytics.utils.files import file_size, spaces_in_path
|
108
|
-
from ultralytics.utils.ops import Profile, nms_rotated
|
108
|
+
from ultralytics.utils.ops import Profile, nms_rotated
|
109
109
|
from ultralytics.utils.torch_utils import TORCH_1_13, get_latest_opset, select_device
|
110
110
|
|
111
111
|
|
@@ -113,7 +113,7 @@ def export_formats():
|
|
113
113
|
"""Return a dictionary of Ultralytics YOLO export formats."""
|
114
114
|
x = [
|
115
115
|
["PyTorch", "-", ".pt", True, True, []],
|
116
|
-
["TorchScript", "torchscript", ".torchscript", True, True, ["batch", "optimize", "nms"]],
|
116
|
+
["TorchScript", "torchscript", ".torchscript", True, True, ["batch", "optimize", "half", "nms"]],
|
117
117
|
["ONNX", "onnx", ".onnx", True, True, ["batch", "dynamic", "half", "opset", "simplify", "nms"]],
|
118
118
|
[
|
119
119
|
"OpenVINO",
|
@@ -384,6 +384,7 @@ class Exporter:
|
|
384
384
|
m.export = True
|
385
385
|
m.format = self.args.format
|
386
386
|
m.max_det = self.args.max_det
|
387
|
+
m.xyxy = self.args.nms
|
387
388
|
elif isinstance(m, C2f) and not is_tf_format:
|
388
389
|
# EdgeTPU does not support FlexSplitV while split provides cleaner ONNX graph
|
389
390
|
m.forward = m.forward_split
|
@@ -1532,11 +1533,6 @@ class NMSModel(torch.nn.Module):
|
|
1532
1533
|
# Explicit length otherwise reshape error, hardcoded to `self.args.max_det * 5`
|
1533
1534
|
mask = score.topk(min(self.args.max_det * 5, score.shape[0])).indices
|
1534
1535
|
box, score, cls, extra = box[mask], score[mask], cls[mask], extra[mask]
|
1535
|
-
if not self.obb:
|
1536
|
-
box = xywh2xyxy(box)
|
1537
|
-
if self.is_tf:
|
1538
|
-
# TFlite bug returns less boxes
|
1539
|
-
box = torch.nn.functional.pad(box, (0, 0, 0, mask.shape[0] - box.shape[0]))
|
1540
1536
|
nmsbox = box.clone()
|
1541
1537
|
# `8` is the minimum value experimented to get correct NMS results for obb
|
1542
1538
|
multiplier = 8 if self.obb else 1
|
@@ -299,8 +299,8 @@ class Results(SimpleClass):
|
|
299
299
|
Return the number of detections in the Results object.
|
300
300
|
|
301
301
|
Returns:
|
302
|
-
(int): The number of detections, determined by the length of the first non-empty
|
303
|
-
(
|
302
|
+
(int): The number of detections, determined by the length of the first non-empty
|
303
|
+
attribute in (masks, probs, keypoints, or obb).
|
304
304
|
|
305
305
|
Examples:
|
306
306
|
>>> results = Results(orig_img, path, names, boxes=torch.rand(5, 4))
|
@@ -779,9 +779,9 @@ class Results(SimpleClass):
|
|
779
779
|
decimals (int): Number of decimal places to round the output values to.
|
780
780
|
|
781
781
|
Returns:
|
782
|
-
(List[Dict]): A list of dictionaries, each containing summarized information for a single
|
783
|
-
|
784
|
-
|
782
|
+
(List[Dict]): A list of dictionaries, each containing summarized information for a single detection
|
783
|
+
or classification result. The structure of each dictionary varies based on the task type
|
784
|
+
(classification or detection) and available information (boxes, masks, keypoints).
|
785
785
|
|
786
786
|
Examples:
|
787
787
|
>>> results = model("image.jpg")
|
@@ -16,9 +16,8 @@ def select_closest_cond_frames(frame_idx, cond_frame_outputs, max_cond_frame_num
|
|
16
16
|
max_cond_frame_num (int): Maximum number of conditioning frames to select.
|
17
17
|
|
18
18
|
Returns:
|
19
|
-
(
|
20
|
-
|
21
|
-
- unselected_outputs: Items not selected from cond_frame_outputs.
|
19
|
+
selected_outputs (Dict[int, Any]): Selected items from cond_frame_outputs.
|
20
|
+
unselected_outputs (Dict[int, Any]): Items not selected from cond_frame_outputs.
|
22
21
|
|
23
22
|
Examples:
|
24
23
|
>>> frame_idx = 5
|
@@ -235,9 +234,8 @@ def window_partition(x, window_size):
|
|
235
234
|
window_size (int): Size of each window.
|
236
235
|
|
237
236
|
Returns:
|
238
|
-
(
|
239
|
-
|
240
|
-
- (Hp, Wp) (Tuple[int, int]): Padded height and width before partition.
|
237
|
+
windows (torch.Tensor): Partitioned windows with shape (B * num_windows, window_size, window_size, C).
|
238
|
+
padded_h_w (Tuple[int, int]): Padded height and width before partition.
|
241
239
|
|
242
240
|
Examples:
|
243
241
|
>>> x = torch.randn(1, 16, 16, 3)
|
@@ -32,7 +32,16 @@ class DETRLoss(nn.Module):
|
|
32
32
|
"""
|
33
33
|
|
34
34
|
def __init__(
|
35
|
-
self,
|
35
|
+
self,
|
36
|
+
nc=80,
|
37
|
+
loss_gain=None,
|
38
|
+
aux_loss=True,
|
39
|
+
use_fl=True,
|
40
|
+
use_vfl=False,
|
41
|
+
use_uni_match=False,
|
42
|
+
uni_match_ind=0,
|
43
|
+
gamma=1.5,
|
44
|
+
alpha=0.25,
|
36
45
|
):
|
37
46
|
"""
|
38
47
|
Initialize DETR loss function with customizable components and gains.
|
@@ -48,6 +57,8 @@ class DETRLoss(nn.Module):
|
|
48
57
|
use_vfl (bool): Whether to use VarifocalLoss.
|
49
58
|
use_uni_match (bool): Whether to use fixed layer for auxiliary branch label assignment.
|
50
59
|
uni_match_ind (int): Index of fixed layer for uni_match.
|
60
|
+
gamma (float): The focusing parameter that controls how much the loss focuses on hard-to-classify examples.
|
61
|
+
alpha (float): The balancing factor used to address class imbalance.
|
51
62
|
"""
|
52
63
|
super().__init__()
|
53
64
|
|
@@ -57,8 +68,8 @@ class DETRLoss(nn.Module):
|
|
57
68
|
self.matcher = HungarianMatcher(cost_gain={"class": 2, "bbox": 5, "giou": 2})
|
58
69
|
self.loss_gain = loss_gain
|
59
70
|
self.aux_loss = aux_loss
|
60
|
-
self.fl = FocalLoss() if use_fl else None
|
61
|
-
self.vfl = VarifocalLoss() if use_vfl else None
|
71
|
+
self.fl = FocalLoss(gamma, alpha) if use_fl else None
|
72
|
+
self.vfl = VarifocalLoss(gamma, alpha) if use_vfl else None
|
62
73
|
|
63
74
|
self.use_uni_match = use_uni_match
|
64
75
|
self.uni_match_ind = uni_match_ind
|
@@ -144,7 +144,7 @@ class YOLOWorld(Model):
|
|
144
144
|
class YOLOE(Model):
|
145
145
|
"""YOLOE object detection and segmentation model."""
|
146
146
|
|
147
|
-
def __init__(self, model="yoloe-
|
147
|
+
def __init__(self, model="yoloe-11s-seg.pt", task=None, verbose=False) -> None:
|
148
148
|
"""
|
149
149
|
Initialize YOLOE model with a pre-trained model file.
|
150
150
|
|
@@ -197,7 +197,7 @@ class YOLOE(Model):
|
|
197
197
|
(torch.Tensor): Visual positional embeddings.
|
198
198
|
|
199
199
|
Examples:
|
200
|
-
>>> model = YOLOE("yoloe-
|
200
|
+
>>> model = YOLOE("yoloe-11s-seg.pt")
|
201
201
|
>>> img = torch.rand(1, 3, 640, 640)
|
202
202
|
>>> visual_features = model.model.backbone(img)
|
203
203
|
>>> pe = model.get_visual_pe(img, visual_features)
|
@@ -220,7 +220,7 @@ class YOLOE(Model):
|
|
220
220
|
AssertionError: If the model is not an instance of YOLOEModel.
|
221
221
|
|
222
222
|
Examples:
|
223
|
-
>>> model = YOLOE("yoloe-
|
223
|
+
>>> model = YOLOE("yoloe-11s-seg.pt")
|
224
224
|
>>> model.set_vocab(["person", "car", "dog"], ["person", "car", "dog"])
|
225
225
|
"""
|
226
226
|
assert isinstance(self.model, YOLOEModel)
|
@@ -304,7 +304,7 @@ class YOLOE(Model):
|
|
304
304
|
(List | generator): List of Results objects or generator of Results objects if stream=True.
|
305
305
|
|
306
306
|
Examples:
|
307
|
-
>>> model = YOLOE("yoloe-
|
307
|
+
>>> model = YOLOE("yoloe-11s-seg.pt")
|
308
308
|
>>> results = model.predict("path/to/image.jpg")
|
309
309
|
>>> # With visual prompts
|
310
310
|
>>> prompts = {"bboxes": [[10, 20, 100, 200]], "cls": ["person"]}
|
@@ -59,7 +59,7 @@ class SegmentationPredictor(DetectionPredictor):
|
|
59
59
|
Each Results object includes both bounding boxes and segmentation masks.
|
60
60
|
|
61
61
|
Examples:
|
62
|
-
>>> predictor = SegmentationPredictor(overrides=dict(model="
|
62
|
+
>>> predictor = SegmentationPredictor(overrides=dict(model="yolo11n-seg.pt"))
|
63
63
|
>>> results = predictor.postprocess(preds, img, orig_img)
|
64
64
|
"""
|
65
65
|
# Extract protos - tuple if PyTorch model or array if exported
|
@@ -447,9 +447,8 @@ class RepConv(nn.Module):
|
|
447
447
|
Calculate equivalent kernel and bias by fusing convolutions.
|
448
448
|
|
449
449
|
Returns:
|
450
|
-
(
|
451
|
-
|
452
|
-
- Equivalent bias (torch.Tensor)
|
450
|
+
(torch.Tensor): Equivalent kernel
|
451
|
+
(torch.Tensor): Equivalent bias
|
453
452
|
"""
|
454
453
|
kernel3x3, bias3x3 = self._fuse_bn_tensor(self.conv1)
|
455
454
|
kernel1x1, bias1x1 = self._fuse_bn_tensor(self.conv2)
|
@@ -480,9 +479,8 @@ class RepConv(nn.Module):
|
|
480
479
|
branch (Conv | nn.BatchNorm2d | None): Branch to fuse.
|
481
480
|
|
482
481
|
Returns:
|
483
|
-
(
|
484
|
-
|
485
|
-
- Fused bias (torch.Tensor)
|
482
|
+
(torch.Tensor): Fused kernel
|
483
|
+
(torch.Tensor): Fused bias
|
486
484
|
"""
|
487
485
|
if branch is None:
|
488
486
|
return 0, 0
|
@@ -32,6 +32,7 @@ class Detect(nn.Module):
|
|
32
32
|
anchors = torch.empty(0) # init
|
33
33
|
strides = torch.empty(0) # init
|
34
34
|
legacy = False # backward compatibility for v3/v5/v8/v9 models
|
35
|
+
xyxy = False # xyxy or xywh output
|
35
36
|
|
36
37
|
def __init__(self, nc=80, ch=()):
|
37
38
|
"""Initialize the YOLO detection layer with specified number of classes and channels."""
|
@@ -83,9 +84,10 @@ class Detect(nn.Module):
|
|
83
84
|
x (List[torch.Tensor]): Input feature maps from different levels.
|
84
85
|
|
85
86
|
Returns:
|
86
|
-
(dict | tuple):
|
87
|
-
|
88
|
-
|
87
|
+
(dict | tuple):
|
88
|
+
|
89
|
+
- If in training mode, returns a dictionary containing outputs of both one2many and one2one detections.
|
90
|
+
- If not in training mode, returns processed detections or a tuple with processed detections and raw outputs.
|
89
91
|
"""
|
90
92
|
x_detach = [xi.detach() for xi in x]
|
91
93
|
one2one = [
|
@@ -156,7 +158,7 @@ class Detect(nn.Module):
|
|
156
158
|
|
157
159
|
def decode_bboxes(self, bboxes, anchors, xywh=True):
|
158
160
|
"""Decode bounding boxes."""
|
159
|
-
return dist2bbox(bboxes, anchors, xywh=xywh and
|
161
|
+
return dist2bbox(bboxes, anchors, xywh=xywh and not (self.end2end or self.xyxy), dim=1)
|
160
162
|
|
161
163
|
@staticmethod
|
162
164
|
def postprocess(preds: torch.Tensor, max_det: int, nc: int = 80):
|
@@ -103,12 +103,13 @@ class AIGym(BaseSolution):
|
|
103
103
|
self.stage[ind] = "up"
|
104
104
|
|
105
105
|
# Display angle, count, and stage text
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
106
|
+
if self.show_labels:
|
107
|
+
annotator.plot_angle_and_count_and_stage(
|
108
|
+
angle_text=self.angle[ind], # angle text for display
|
109
|
+
count_text=self.count[ind], # count text for workouts
|
110
|
+
stage_text=self.stage[ind], # stage position text
|
111
|
+
center_kpt=k[int(self.kpts[1])], # center keypoint for display
|
112
|
+
)
|
112
113
|
plot_im = annotator.result()
|
113
114
|
self.display_output(plot_im) # Display output image, if environment support display
|
114
115
|
|
@@ -95,8 +95,8 @@ class DistanceCalculation(BaseSolution):
|
|
95
95
|
|
96
96
|
pixels_distance = 0
|
97
97
|
# Iterate over bounding boxes, track ids and classes index
|
98
|
-
for box, track_id, cls in zip(self.boxes, self.track_ids, self.clss):
|
99
|
-
annotator.box_label(box, color=colors(int(cls), True), label=self.
|
98
|
+
for box, track_id, cls, conf in zip(self.boxes, self.track_ids, self.clss, self.confs):
|
99
|
+
annotator.box_label(box, color=colors(int(cls), True), label=self.adjust_box_label(cls, conf, track_id))
|
100
100
|
|
101
101
|
# Update selected boxes if they're being tracked
|
102
102
|
if len(self.selected_boxes) == 2:
|
@@ -72,7 +72,7 @@ class ObjectBlurrer(BaseSolution):
|
|
72
72
|
annotator = SolutionAnnotator(im0, self.line_width)
|
73
73
|
|
74
74
|
# Iterate over bounding boxes and classes
|
75
|
-
for box, cls in zip(self.boxes, self.clss):
|
75
|
+
for box, cls, conf in zip(self.boxes, self.clss, self.confs):
|
76
76
|
# Crop and blur the detected object
|
77
77
|
blur_obj = cv2.blur(
|
78
78
|
im0[int(box[1]) : int(box[3]), int(box[0]) : int(box[2])],
|
@@ -80,7 +80,9 @@ class ObjectBlurrer(BaseSolution):
|
|
80
80
|
)
|
81
81
|
# Update the blurred area in the original image
|
82
82
|
im0[int(box[1]) : int(box[3]), int(box[0]) : int(box[2])] = blur_obj
|
83
|
-
annotator.box_label(
|
83
|
+
annotator.box_label(
|
84
|
+
box, label=self.adjust_box_label(cls, conf), color=colors(cls, True)
|
85
|
+
) # Annotate bounding box
|
84
86
|
|
85
87
|
plot_im = annotator.result()
|
86
88
|
self.display_output(plot_im) # Display the output using the base class function
|
@@ -179,9 +179,9 @@ class ObjectCounter(BaseSolution):
|
|
179
179
|
) # Draw region
|
180
180
|
|
181
181
|
# Iterate over bounding boxes, track ids and classes index
|
182
|
-
for box, track_id, cls in zip(self.boxes, self.track_ids, self.clss):
|
182
|
+
for box, track_id, cls, conf in zip(self.boxes, self.track_ids, self.clss, self.confs):
|
183
183
|
# Draw bounding box and counting region
|
184
|
-
self.annotator.box_label(box, label=self.
|
184
|
+
self.annotator.box_label(box, label=self.adjust_box_label(cls, conf, track_id), color=colors(cls, True))
|
185
185
|
self.store_tracking_history(track_id, box) # Store track history
|
186
186
|
self.store_classwise_counts(cls) # Store classwise counts in dict
|
187
187
|
|
@@ -64,9 +64,9 @@ class QueueManager(BaseSolution):
|
|
64
64
|
annotator = SolutionAnnotator(im0, line_width=self.line_width) # Initialize annotator
|
65
65
|
annotator.draw_region(reg_pts=self.region, color=self.rect_color, thickness=self.line_width * 2) # Draw region
|
66
66
|
|
67
|
-
for box, track_id, cls in zip(self.boxes, self.track_ids, self.clss):
|
67
|
+
for box, track_id, cls, conf in zip(self.boxes, self.track_ids, self.clss, self.confs):
|
68
68
|
# Draw bounding box and counting region
|
69
|
-
annotator.box_label(box, label=self.
|
69
|
+
annotator.box_label(box, label=self.adjust_box_label(cls, conf, track_id), color=colors(track_id, True))
|
70
70
|
self.store_tracking_history(track_id, box) # Store track history
|
71
71
|
|
72
72
|
# Cache frequently accessed attributes
|
@@ -96,8 +96,8 @@ class RegionCounter(BaseSolution):
|
|
96
96
|
|
97
97
|
# Process bounding boxes & check containment
|
98
98
|
if points:
|
99
|
-
for point, cls, track_id, box in zip(points, self.clss, self.track_ids, self.boxes):
|
100
|
-
annotator.box_label(box, label=self.
|
99
|
+
for point, cls, track_id, box, conf in zip(points, self.clss, self.track_ids, self.boxes, self.confs):
|
100
|
+
annotator.box_label(box, label=self.adjust_box_label(cls, conf, track_id), color=colors(track_id, True))
|
101
101
|
|
102
102
|
for region in self.counting_regions:
|
103
103
|
if region["prepared_polygon"].contains(point):
|
@@ -82,12 +82,14 @@ class BaseSolution:
|
|
82
82
|
self.region = self.CFG["region"] # Store region data for other classes usage
|
83
83
|
self.line_width = self.CFG["line_width"] if self.CFG["line_width"] not in (None, 0) else 2 # Store line_width
|
84
84
|
|
85
|
-
# Load Model and store classes
|
85
|
+
# Load Model and store additional information (classes, show_conf, show_label)
|
86
86
|
if self.CFG["model"] is None:
|
87
87
|
self.CFG["model"] = "yolo11n.pt"
|
88
88
|
self.model = YOLO(self.CFG["model"])
|
89
89
|
self.names = self.model.names
|
90
90
|
self.classes = self.CFG["classes"]
|
91
|
+
self.show_conf = self.CFG["show_conf"]
|
92
|
+
self.show_labels = self.CFG["show_labels"]
|
91
93
|
|
92
94
|
self.track_add_args = { # Tracker additional arguments for advance configuration
|
93
95
|
k: self.CFG[k] for k in ["iou", "conf", "device", "max_det", "half", "tracker", "device", "verbose"]
|
@@ -105,6 +107,25 @@ class BaseSolution:
|
|
105
107
|
self.env_check = check_imshow(warn=True)
|
106
108
|
self.track_history = defaultdict(list)
|
107
109
|
|
110
|
+
def adjust_box_label(self, cls, conf, track_id=None):
|
111
|
+
"""
|
112
|
+
Generates a formatted label for a bounding box.
|
113
|
+
|
114
|
+
This method constructs a label string for a bounding box using the class index and confidence score.
|
115
|
+
Optionally includes the track ID if provided. The label format adapts based on the display settings
|
116
|
+
defined in `self.show_conf` and `self.show_labels`.
|
117
|
+
|
118
|
+
Args:
|
119
|
+
cls (int): The class index of the detected object.
|
120
|
+
conf (float): The confidence score of the detection.
|
121
|
+
track_id (int, optional): The unique identifier for the tracked object. Defaults to None.
|
122
|
+
|
123
|
+
Returns:
|
124
|
+
(str or None): The formatted label string if `self.show_labels` is True; otherwise, None.
|
125
|
+
"""
|
126
|
+
name = ("" if track_id is None else f"{track_id} ") + self.names[cls]
|
127
|
+
return (f"{name} {conf:.2f}" if self.show_conf else name) if self.show_labels else None
|
128
|
+
|
108
129
|
def extract_tracks(self, im0):
|
109
130
|
"""
|
110
131
|
Applies object tracking and extracts tracks from an input image or frame.
|
@@ -128,9 +149,10 @@ class BaseSolution:
|
|
128
149
|
self.boxes = self.track_data.xyxy.cpu()
|
129
150
|
self.clss = self.track_data.cls.cpu().tolist()
|
130
151
|
self.track_ids = self.track_data.id.int().cpu().tolist()
|
152
|
+
self.confs = self.track_data.conf.cpu().tolist()
|
131
153
|
else:
|
132
154
|
self.LOGGER.warning("no tracks found!")
|
133
|
-
self.boxes, self.clss, self.track_ids = [], [], []
|
155
|
+
self.boxes, self.clss, self.track_ids, self.confs = [], [], [], []
|
134
156
|
|
135
157
|
def store_tracking_history(self, track_id, box):
|
136
158
|
"""
|
@@ -73,7 +73,7 @@ class SpeedEstimator(BaseSolution):
|
|
73
73
|
# Draw speed estimation region
|
74
74
|
annotator.draw_region(reg_pts=self.region, color=(104, 0, 123), thickness=self.line_width * 2)
|
75
75
|
|
76
|
-
for box, track_id, cls in zip(self.boxes, self.track_ids, self.clss):
|
76
|
+
for box, track_id, cls, conf in zip(self.boxes, self.track_ids, self.clss, self.confs):
|
77
77
|
self.store_tracking_history(track_id, box) # Store track history
|
78
78
|
|
79
79
|
# Initialize tracking data for new objects
|
@@ -82,8 +82,11 @@ class SpeedEstimator(BaseSolution):
|
|
82
82
|
if track_id not in self.trk_pp:
|
83
83
|
self.trk_pp[track_id] = self.track_line[-1]
|
84
84
|
|
85
|
-
|
86
|
-
|
85
|
+
speed_label = (
|
86
|
+
f"{int(self.spd[track_id])} km/h"
|
87
|
+
if track_id in self.spd and self.show_labels
|
88
|
+
else self.adjust_box_label(cls, conf, track_id)
|
89
|
+
)
|
87
90
|
annotator.box_label(box, label=speed_label, color=colors(track_id, True)) # Draw bounding box
|
88
91
|
|
89
92
|
# Determine if object is crossing the speed estimation region
|
@@ -76,8 +76,10 @@ class TrackZone(BaseSolution):
|
|
76
76
|
cv2.polylines(im0, [self.region], isClosed=True, color=(255, 255, 255), thickness=self.line_width * 2)
|
77
77
|
|
78
78
|
# Iterate over boxes, track ids, classes indexes list and draw bounding boxes
|
79
|
-
for box, track_id, cls in zip(self.boxes, self.track_ids, self.clss):
|
80
|
-
annotator.box_label(
|
79
|
+
for box, track_id, cls, conf in zip(self.boxes, self.track_ids, self.clss, self.confs):
|
80
|
+
annotator.box_label(
|
81
|
+
box, label=self.adjust_box_label(cls, conf, track_id=track_id), color=colors(track_id, True)
|
82
|
+
)
|
81
83
|
|
82
84
|
plot_im = annotator.result()
|
83
85
|
self.display_output(plot_im) # display output with base class function
|
@@ -57,9 +57,9 @@ class VisionEye(BaseSolution):
|
|
57
57
|
self.extract_tracks(im0) # Extract tracks (bounding boxes, classes, and masks)
|
58
58
|
annotator = SolutionAnnotator(im0, self.line_width)
|
59
59
|
|
60
|
-
for cls, t_id, box in zip(self.clss, self.track_ids, self.boxes):
|
60
|
+
for cls, t_id, box, conf in zip(self.clss, self.track_ids, self.boxes, self.confs):
|
61
61
|
# Annotate the image with bounding boxes, labels, and vision mapping
|
62
|
-
annotator.box_label(box, label=self.
|
62
|
+
annotator.box_label(box, label=self.adjust_box_label(cls, conf, t_id), color=colors(int(t_id), True))
|
63
63
|
annotator.visioneye(box, self.vision_point)
|
64
64
|
|
65
65
|
plot_im = annotator.result()
|
@@ -87,7 +87,7 @@ def parse_version(version="0.0.0") -> tuple:
|
|
87
87
|
version (str): Version string, i.e. '2.0.1+cpu'
|
88
88
|
|
89
89
|
Returns:
|
90
|
-
(
|
90
|
+
(Tuple[int, int, int]): Tuple of integers representing the numeric part of the version, i.e. (2, 0, 1)
|
91
91
|
"""
|
92
92
|
try:
|
93
93
|
return tuple(map(int, re.findall(r"\d+", version)[:3])) # '2.0.1+cpu' -> (2, 0, 1)
|
@@ -18,16 +18,21 @@ class VarifocalLoss(nn.Module):
|
|
18
18
|
Varifocal loss by Zhang et al.
|
19
19
|
|
20
20
|
https://arxiv.org/abs/2008.13367.
|
21
|
+
|
22
|
+
Args:
|
23
|
+
gamma (float): The focusing parameter that controls how much the loss focuses on hard-to-classify examples.
|
24
|
+
alpha (float): The balancing factor used to address class imbalance.
|
21
25
|
"""
|
22
26
|
|
23
|
-
def __init__(self):
|
27
|
+
def __init__(self, gamma=2.0, alpha=0.75):
|
24
28
|
"""Initialize the VarifocalLoss class."""
|
25
29
|
super().__init__()
|
30
|
+
self.gamma = gamma
|
31
|
+
self.alpha = alpha
|
26
32
|
|
27
|
-
|
28
|
-
def forward(pred_score, gt_score, label, alpha=0.75, gamma=2.0):
|
33
|
+
def forward(self, pred_score, gt_score, label):
|
29
34
|
"""Compute varifocal loss between predictions and ground truth."""
|
30
|
-
weight = alpha * pred_score.sigmoid().pow(gamma) * (1 - label) + gt_score * label
|
35
|
+
weight = self.alpha * pred_score.sigmoid().pow(self.gamma) * (1 - label) + gt_score * label
|
31
36
|
with autocast(enabled=False):
|
32
37
|
loss = (
|
33
38
|
(F.binary_cross_entropy_with_logits(pred_score.float(), gt_score.float(), reduction="none") * weight)
|
@@ -38,14 +43,21 @@ class VarifocalLoss(nn.Module):
|
|
38
43
|
|
39
44
|
|
40
45
|
class FocalLoss(nn.Module):
|
41
|
-
"""
|
46
|
+
"""
|
47
|
+
Wraps focal loss around existing loss_fcn(), i.e. criteria = FocalLoss(nn.BCEWithLogitsLoss(), gamma=1.5).
|
42
48
|
|
43
|
-
|
49
|
+
Args:
|
50
|
+
gamma (float): The focusing parameter that controls how much the loss focuses on hard-to-classify examples.
|
51
|
+
alpha (float): The balancing factor used to address class imbalance.
|
52
|
+
"""
|
53
|
+
|
54
|
+
def __init__(self, gamma=1.5, alpha=0.25):
|
44
55
|
"""Initialize FocalLoss class with no parameters."""
|
45
56
|
super().__init__()
|
57
|
+
self.gamma = gamma
|
58
|
+
self.alpha = alpha
|
46
59
|
|
47
|
-
|
48
|
-
def forward(pred, label, gamma=1.5, alpha=0.25):
|
60
|
+
def forward(self, pred, label):
|
49
61
|
"""Calculate focal loss with modulating factors for class imbalance."""
|
50
62
|
loss = F.binary_cross_entropy_with_logits(pred, label, reduction="none")
|
51
63
|
# p_t = torch.exp(-loss)
|
@@ -54,10 +66,10 @@ class FocalLoss(nn.Module):
|
|
54
66
|
# TF implementation https://github.com/tensorflow/addons/blob/v0.7.1/tensorflow_addons/losses/focal_loss.py
|
55
67
|
pred_prob = pred.sigmoid() # prob from logits
|
56
68
|
p_t = label * pred_prob + (1 - label) * (1 - pred_prob)
|
57
|
-
modulating_factor = (1.0 - p_t) ** gamma
|
69
|
+
modulating_factor = (1.0 - p_t) ** self.gamma
|
58
70
|
loss *= modulating_factor
|
59
|
-
if alpha > 0:
|
60
|
-
alpha_factor = label * alpha + (1 - label) * (1 - alpha)
|
71
|
+
if self.alpha > 0:
|
72
|
+
alpha_factor = label * self.alpha + (1 - label) * (1 - self.alpha)
|
61
73
|
loss *= alpha_factor
|
62
74
|
return loss.mean(1).sum()
|
63
75
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.116
|
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>
|