ultralytics 8.3.166__tar.gz → 8.3.168__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.166/ultralytics.egg-info → ultralytics-8.3.168}/PKG-INFO +1 -1
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/__init__.py +1 -1
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/exporter.py +37 -18
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/rtdetr/val.py +22 -38
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/detect/val.py +23 -17
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/model.py +1 -5
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/obb/val.py +15 -31
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/pose/val.py +11 -46
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/segment/val.py +12 -40
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/autobackend.py +7 -8
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/head.py +4 -6
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/region_counter.py +2 -1
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/similarity_search.py +2 -1
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/solutions.py +30 -63
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/streamlit_inference.py +57 -14
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/metrics.py +4 -5
- {ultralytics-8.3.166 → ultralytics-8.3.168/ultralytics.egg-info}/PKG-INFO +1 -1
- {ultralytics-8.3.166 → ultralytics-8.3.168}/LICENSE +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/README.md +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/pyproject.toml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/setup.cfg +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/conftest.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_cli.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_cuda.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_engine.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_exports.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_integrations.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_python.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/tests/test_solutions.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/assets/bus.jpg +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/assets/zidane.jpg +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/HomeObjects-3K.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/VOC.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco128.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco8-grayscale.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco8-multispectral.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/coco8.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/dog-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/dota8-multispectral.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/dota8.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/lvis.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/medical-pills.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/signature.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/datasets/xView.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/default.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yoloe-11-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/11/yoloe-11.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/12/yolo12-cls.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/12/yolo12-obb.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/12/yolo12-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/12/yolo12-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/12/yolo12.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yoloe-v8-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yoloe-v8.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/trackers/botsort.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/annotator.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/augment.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/base.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/build.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/converter.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/dataset.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/loaders.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/scripts/download_weights.sh +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/scripts/get_coco.sh +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/scripts/get_coco128.sh +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/scripts/get_imagenet.sh +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/split.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/split_dota.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/data/utils.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/model.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/predictor.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/results.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/trainer.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/tuner.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/engine/validator.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/hub/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/hub/auth.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/hub/google/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/hub/session.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/hub/utils.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/fastsam/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/fastsam/model.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/fastsam/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/fastsam/utils.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/fastsam/val.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/nas/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/nas/model.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/nas/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/nas/val.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/rtdetr/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/rtdetr/model.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/rtdetr/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/rtdetr/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/amg.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/build.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/model.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/blocks.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/decoders.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/encoders.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/memory_attention.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/sam.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/transformer.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/modules/utils.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/sam/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/utils/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/utils/loss.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/utils/ops.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/classify/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/classify/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/classify/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/classify/val.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/detect/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/detect/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/detect/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/obb/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/obb/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/obb/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/pose/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/pose/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/pose/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/segment/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/segment/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/segment/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/world/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/world/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/world/train_world.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/yoloe/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/yoloe/predict.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/yoloe/train.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/yoloe/train_seg.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/models/yolo/yoloe/val.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/activation.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/block.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/conv.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/transformer.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/modules/utils.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/tasks.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/nn/text_model.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/ai_gym.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/analytics.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/config.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/distance_calculation.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/heatmap.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/instance_segmentation.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/object_blurrer.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/object_counter.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/object_cropper.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/parking_management.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/queue_management.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/security_alarm.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/speed_estimation.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/templates/similarity-search.html +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/trackzone.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/solutions/vision_eye.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/basetrack.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/bot_sort.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/byte_tracker.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/track.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/utils/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/utils/gmc.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/utils/kalman_filter.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/trackers/utils/matching.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/autobatch.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/autodevice.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/benchmarks.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/__init__.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/base.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/clearml.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/comet.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/dvc.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/hub.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/mlflow.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/neptune.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/raytune.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/tensorboard.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/callbacks/wb.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/checks.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/dist.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/downloads.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/errors.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/export.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/files.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/instance.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/loss.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/ops.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/patches.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/plotting.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/tal.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/torch_utils.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/triton.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics/utils/tuner.py +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics.egg-info/SOURCES.txt +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics.egg-info/dependency_links.txt +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics.egg-info/entry_points.txt +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/ultralytics.egg-info/requires.txt +0 -0
- {ultralytics-8.3.166 → ultralytics-8.3.168}/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.168
|
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>
|
@@ -142,7 +142,7 @@ def export_formats():
|
|
142
142
|
["PaddlePaddle", "paddle", "_paddle_model", True, True, ["batch"]],
|
143
143
|
["MNN", "mnn", ".mnn", True, True, ["batch", "half", "int8"]],
|
144
144
|
["NCNN", "ncnn", "_ncnn_model", True, True, ["batch", "half"]],
|
145
|
-
["IMX", "imx", "_imx_model", True, True, ["int8", "fraction"]],
|
145
|
+
["IMX", "imx", "_imx_model", True, True, ["int8", "fraction", "nms"]],
|
146
146
|
["RKNN", "rknn", "_rknn_model", False, False, ["batch", "name"]],
|
147
147
|
]
|
148
148
|
return dict(zip(["Format", "Argument", "Suffix", "CPU", "GPU", "Arguments"], zip(*x)))
|
@@ -313,8 +313,11 @@ class Exporter:
|
|
313
313
|
if not self.args.int8:
|
314
314
|
LOGGER.warning("IMX export requires int8=True, setting int8=True.")
|
315
315
|
self.args.int8 = True
|
316
|
-
if
|
317
|
-
|
316
|
+
if not self.args.nms:
|
317
|
+
LOGGER.warning("IMX export requires nms=True, setting nms=True.")
|
318
|
+
self.args.nms = True
|
319
|
+
if model.task not in {"detect", "pose"}:
|
320
|
+
raise ValueError("IMX export only supported for detection and pose estimation models.")
|
318
321
|
if not hasattr(model, "names"):
|
319
322
|
model.names = default_class_names()
|
320
323
|
model.names = check_class_names(model.names)
|
@@ -428,7 +431,7 @@ class Exporter:
|
|
428
431
|
|
429
432
|
y = None
|
430
433
|
for _ in range(2): # dry runs
|
431
|
-
y = NMSModel(model, self.args)(im) if self.args.nms and not coreml else model(im)
|
434
|
+
y = NMSModel(model, self.args)(im) if self.args.nms and not (coreml or imx) else model(im)
|
432
435
|
if self.args.half and onnx and self.device.type != "cpu":
|
433
436
|
im, model = im.half(), model.half() # to FP16
|
434
437
|
|
@@ -1166,15 +1169,14 @@ class Exporter:
|
|
1166
1169
|
)
|
1167
1170
|
if getattr(self.model, "end2end", False):
|
1168
1171
|
raise ValueError("IMX export is not supported for end2end models.")
|
1169
|
-
check_requirements(
|
1170
|
-
("model-compression-toolkit>=2.3.0,<2.4.1", "sony-custom-layers>=0.3.0", "edge-mdt-tpc>=1.1.0")
|
1171
|
-
)
|
1172
|
+
check_requirements(("model-compression-toolkit>=2.4.1", "sony-custom-layers>=0.3.0", "edge-mdt-tpc>=1.1.0"))
|
1172
1173
|
check_requirements("imx500-converter[pt]>=3.16.1") # Separate requirements for imx500-converter
|
1174
|
+
check_requirements("mct-quantizers>=1.6.0") # Separate for compatibility with model-compression-toolkit
|
1173
1175
|
|
1174
1176
|
import model_compression_toolkit as mct
|
1175
1177
|
import onnx
|
1176
1178
|
from edgemdt_tpc import get_target_platform_capabilities
|
1177
|
-
from sony_custom_layers.pytorch import
|
1179
|
+
from sony_custom_layers.pytorch import multiclass_nms_with_indices
|
1178
1180
|
|
1179
1181
|
LOGGER.info(f"\n{prefix} starting export with model_compression_toolkit {mct.__version__}...")
|
1180
1182
|
|
@@ -1198,13 +1200,23 @@ class Exporter:
|
|
1198
1200
|
|
1199
1201
|
bit_cfg = mct.core.BitWidthConfig()
|
1200
1202
|
if "C2PSA" in self.model.__str__(): # YOLO11
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1203
|
+
if self.model.task == "detect":
|
1204
|
+
layer_names = ["sub", "mul_2", "add_14", "cat_21"]
|
1205
|
+
weights_memory = 2585350.2439
|
1206
|
+
n_layers = 238 # 238 layers for fused YOLO11n
|
1207
|
+
elif self.model.task == "pose":
|
1208
|
+
layer_names = ["sub", "mul_2", "add_14", "cat_22", "cat_23", "mul_4", "add_15"]
|
1209
|
+
weights_memory = 2437771.67
|
1210
|
+
n_layers = 257 # 257 layers for fused YOLO11n-pose
|
1204
1211
|
else: # YOLOv8
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1212
|
+
if self.model.task == "detect":
|
1213
|
+
layer_names = ["sub", "mul", "add_6", "cat_17"]
|
1214
|
+
weights_memory = 2550540.8
|
1215
|
+
n_layers = 168 # 168 layers for fused YOLOv8n
|
1216
|
+
elif self.model.task == "pose":
|
1217
|
+
layer_names = ["add_7", "mul_2", "cat_19", "mul", "sub", "add_6", "cat_18"]
|
1218
|
+
weights_memory = 2482451.85
|
1219
|
+
n_layers = 187 # 187 layers for fused YOLO11n-pose
|
1208
1220
|
|
1209
1221
|
# Check if the model has the expected number of layers
|
1210
1222
|
if len(list(self.model.modules())) != n_layers:
|
@@ -1251,6 +1263,7 @@ class Exporter:
|
|
1251
1263
|
score_threshold: float = 0.001,
|
1252
1264
|
iou_threshold: float = 0.7,
|
1253
1265
|
max_detections: int = 300,
|
1266
|
+
task: str = "detect",
|
1254
1267
|
):
|
1255
1268
|
"""
|
1256
1269
|
Initialize NMSWrapper with PyTorch Module and NMS parameters.
|
@@ -1260,34 +1273,40 @@ class Exporter:
|
|
1260
1273
|
score_threshold (float): Score threshold for non-maximum suppression.
|
1261
1274
|
iou_threshold (float): Intersection over union threshold for non-maximum suppression.
|
1262
1275
|
max_detections (int): The number of detections to return.
|
1276
|
+
task (str): Task type, either 'detect' or 'pose'.
|
1263
1277
|
"""
|
1264
1278
|
super().__init__()
|
1265
1279
|
self.model = model
|
1266
1280
|
self.score_threshold = score_threshold
|
1267
1281
|
self.iou_threshold = iou_threshold
|
1268
1282
|
self.max_detections = max_detections
|
1283
|
+
self.task = task
|
1269
1284
|
|
1270
1285
|
def forward(self, images):
|
1271
1286
|
"""Forward pass with model inference and NMS post-processing."""
|
1272
1287
|
# model inference
|
1273
1288
|
outputs = self.model(images)
|
1274
1289
|
|
1275
|
-
boxes = outputs[0]
|
1276
|
-
|
1277
|
-
nms = multiclass_nms(
|
1290
|
+
boxes, scores = outputs[0], outputs[1]
|
1291
|
+
nms_outputs = multiclass_nms_with_indices(
|
1278
1292
|
boxes=boxes,
|
1279
1293
|
scores=scores,
|
1280
1294
|
score_threshold=self.score_threshold,
|
1281
1295
|
iou_threshold=self.iou_threshold,
|
1282
1296
|
max_detections=self.max_detections,
|
1283
1297
|
)
|
1284
|
-
|
1298
|
+
if self.task == "pose":
|
1299
|
+
kpts = outputs[2] # (bs, max_detections, kpts 17*3)
|
1300
|
+
out_kpts = torch.gather(kpts, 1, nms_outputs.indices.unsqueeze(-1).expand(-1, -1, kpts.size(-1)))
|
1301
|
+
return nms_outputs.boxes, nms_outputs.scores, nms_outputs.labels, out_kpts
|
1302
|
+
return nms_outputs
|
1285
1303
|
|
1286
1304
|
quant_model = NMSWrapper(
|
1287
1305
|
model=quant_model,
|
1288
1306
|
score_threshold=self.args.conf or 0.001,
|
1289
1307
|
iou_threshold=self.args.iou,
|
1290
1308
|
max_detections=self.args.max_det,
|
1309
|
+
task=self.model.task,
|
1291
1310
|
).to(self.device)
|
1292
1311
|
|
1293
1312
|
f = Path(str(self.file).replace(self.file.suffix, "_imx_model"))
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from pathlib import Path
|
3
4
|
from typing import Any, Dict, List, Tuple, Union
|
4
5
|
|
5
6
|
import torch
|
@@ -186,45 +187,28 @@ class RTDETRValidator(DetectionValidator):
|
|
186
187
|
|
187
188
|
return [{"bboxes": x[:, :4], "conf": x[:, 4], "cls": x[:, 5]} for x in outputs]
|
188
189
|
|
189
|
-
def
|
190
|
+
def pred_to_json(self, predn: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> None:
|
190
191
|
"""
|
191
|
-
|
192
|
+
Serialize YOLO predictions to COCO json format.
|
192
193
|
|
193
194
|
Args:
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
Returns:
|
198
|
-
(Dict[str, Any]): Prepared batch with transformed annotations containing cls, bboxes,
|
199
|
-
ori_shape, imgsz, and ratio_pad.
|
200
|
-
"""
|
201
|
-
idx = batch["batch_idx"] == si
|
202
|
-
cls = batch["cls"][idx].squeeze(-1)
|
203
|
-
bbox = batch["bboxes"][idx]
|
204
|
-
ori_shape = batch["ori_shape"][si]
|
205
|
-
imgsz = batch["img"].shape[2:]
|
206
|
-
ratio_pad = batch["ratio_pad"][si]
|
207
|
-
if len(cls):
|
208
|
-
bbox = ops.xywh2xyxy(bbox) # target boxes
|
209
|
-
bbox[..., [0, 2]] *= ori_shape[1] # native-space pred
|
210
|
-
bbox[..., [1, 3]] *= ori_shape[0] # native-space pred
|
211
|
-
return {"cls": cls, "bboxes": bbox, "ori_shape": ori_shape, "imgsz": imgsz, "ratio_pad": ratio_pad}
|
212
|
-
|
213
|
-
def _prepare_pred(self, pred: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> Dict[str, torch.Tensor]:
|
195
|
+
predn (Dict[str, torch.Tensor]): Predictions dictionary containing 'bboxes', 'conf', and 'cls' keys
|
196
|
+
with bounding box coordinates, confidence scores, and class predictions.
|
197
|
+
pbatch (Dict[str, Any]): Batch dictionary containing 'imgsz', 'ori_shape', 'ratio_pad', and 'im_file'.
|
214
198
|
"""
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
199
|
+
stem = Path(pbatch["im_file"]).stem
|
200
|
+
image_id = int(stem) if stem.isnumeric() else stem
|
201
|
+
box = predn["bboxes"].clone()
|
202
|
+
box[..., [0, 2]] *= pbatch["ori_shape"][1] / self.args.imgsz # native-space pred
|
203
|
+
box[..., [1, 3]] *= pbatch["ori_shape"][0] / self.args.imgsz # native-space pred
|
204
|
+
box = ops.xyxy2xywh(box) # xywh
|
205
|
+
box[:, :2] -= box[:, 2:] / 2 # xy center to top-left corner
|
206
|
+
for b, s, c in zip(box.tolist(), predn["conf"].tolist(), predn["cls"].tolist()):
|
207
|
+
self.jdict.append(
|
208
|
+
{
|
209
|
+
"image_id": image_id,
|
210
|
+
"category_id": self.class_map[int(c)],
|
211
|
+
"bbox": [round(x, 3) for x in b],
|
212
|
+
"score": round(s, 5),
|
213
|
+
}
|
214
|
+
)
|
@@ -147,28 +147,28 @@ class DetectionValidator(BaseValidator):
|
|
147
147
|
ratio_pad = batch["ratio_pad"][si]
|
148
148
|
if len(cls):
|
149
149
|
bbox = ops.xywh2xyxy(bbox) * torch.tensor(imgsz, device=self.device)[[1, 0, 1, 0]] # target boxes
|
150
|
-
|
151
|
-
|
150
|
+
return {
|
151
|
+
"cls": cls,
|
152
|
+
"bboxes": bbox,
|
153
|
+
"ori_shape": ori_shape,
|
154
|
+
"imgsz": imgsz,
|
155
|
+
"ratio_pad": ratio_pad,
|
156
|
+
"im_file": batch["im_file"][si],
|
157
|
+
}
|
152
158
|
|
153
|
-
def _prepare_pred(self, pred: Dict[str, torch.Tensor]
|
159
|
+
def _prepare_pred(self, pred: Dict[str, torch.Tensor]) -> Dict[str, torch.Tensor]:
|
154
160
|
"""
|
155
161
|
Prepare predictions for evaluation against ground truth.
|
156
162
|
|
157
163
|
Args:
|
158
164
|
pred (Dict[str, torch.Tensor]): Post-processed predictions from the model.
|
159
|
-
pbatch (Dict[str, Any]): Prepared batch information.
|
160
165
|
|
161
166
|
Returns:
|
162
167
|
(Dict[str, torch.Tensor]): Prepared predictions in native space.
|
163
168
|
"""
|
164
|
-
cls = pred["cls"]
|
165
169
|
if self.args.single_cls:
|
166
|
-
cls *= 0
|
167
|
-
|
168
|
-
bboxes = ops.scale_boxes(
|
169
|
-
pbatch["imgsz"], pred["bboxes"].clone(), pbatch["ori_shape"], ratio_pad=pbatch["ratio_pad"]
|
170
|
-
) # native-space pred
|
171
|
-
return {"bboxes": bboxes, "conf": pred["conf"], "cls": cls}
|
170
|
+
pred["cls"] *= 0
|
171
|
+
return pred
|
172
172
|
|
173
173
|
def update_metrics(self, preds: List[Dict[str, torch.Tensor]], batch: Dict[str, Any]) -> None:
|
174
174
|
"""
|
@@ -181,7 +181,7 @@ class DetectionValidator(BaseValidator):
|
|
181
181
|
for si, pred in enumerate(preds):
|
182
182
|
self.seen += 1
|
183
183
|
pbatch = self._prepare_batch(si, batch)
|
184
|
-
predn = self._prepare_pred(pred
|
184
|
+
predn = self._prepare_pred(pred)
|
185
185
|
|
186
186
|
cls = pbatch["cls"].cpu().numpy()
|
187
187
|
no_pred = len(predn["cls"]) == 0
|
@@ -203,7 +203,7 @@ class DetectionValidator(BaseValidator):
|
|
203
203
|
|
204
204
|
# Save
|
205
205
|
if self.args.save_json:
|
206
|
-
self.pred_to_json(predn,
|
206
|
+
self.pred_to_json(predn, pbatch)
|
207
207
|
if self.args.save_txt:
|
208
208
|
self.save_one_txt(
|
209
209
|
predn,
|
@@ -360,18 +360,24 @@ class DetectionValidator(BaseValidator):
|
|
360
360
|
boxes=torch.cat([predn["bboxes"], predn["conf"].unsqueeze(-1), predn["cls"].unsqueeze(-1)], dim=1),
|
361
361
|
).save_txt(file, save_conf=save_conf)
|
362
362
|
|
363
|
-
def pred_to_json(self, predn: Dict[str, torch.Tensor],
|
363
|
+
def pred_to_json(self, predn: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> None:
|
364
364
|
"""
|
365
365
|
Serialize YOLO predictions to COCO json format.
|
366
366
|
|
367
367
|
Args:
|
368
368
|
predn (Dict[str, torch.Tensor]): Predictions dictionary containing 'bboxes', 'conf', and 'cls' keys
|
369
369
|
with bounding box coordinates, confidence scores, and class predictions.
|
370
|
-
|
370
|
+
pbatch (Dict[str, Any]): Batch dictionary containing 'imgsz', 'ori_shape', 'ratio_pad', and 'im_file'.
|
371
371
|
"""
|
372
|
-
stem = Path(
|
372
|
+
stem = Path(pbatch["im_file"]).stem
|
373
373
|
image_id = int(stem) if stem.isnumeric() else stem
|
374
|
-
box = ops.
|
374
|
+
box = ops.scale_boxes(
|
375
|
+
pbatch["imgsz"],
|
376
|
+
predn["bboxes"].clone(),
|
377
|
+
pbatch["ori_shape"],
|
378
|
+
ratio_pad=pbatch["ratio_pad"],
|
379
|
+
)
|
380
|
+
box = ops.xyxy2xywh(box) # xywh
|
375
381
|
box[:, :2] -= box[:, 2:] / 2 # xy center to top-left corner
|
376
382
|
for b, s, c in zip(box.tolist(), predn["conf"].tolist(), predn["cls"].tolist()):
|
377
383
|
self.jdict.append(
|
@@ -243,10 +243,6 @@ class YOLOE(Model):
|
|
243
243
|
"""
|
244
244
|
super().__init__(model=model, task=task, verbose=verbose)
|
245
245
|
|
246
|
-
# Assign default COCO class names when there are no custom names
|
247
|
-
if not hasattr(self.model, "names"):
|
248
|
-
self.model.names = YAML.load(ROOT / "cfg/datasets/coco8.yaml").get("names")
|
249
|
-
|
250
246
|
@property
|
251
247
|
def task_map(self) -> Dict[str, Dict[str, Any]]:
|
252
248
|
"""Map head to model, validator, and predictor classes."""
|
@@ -287,7 +283,7 @@ class YOLOE(Model):
|
|
287
283
|
Examples:
|
288
284
|
>>> model = YOLOE("yoloe-11s-seg.pt")
|
289
285
|
>>> img = torch.rand(1, 3, 640, 640)
|
290
|
-
>>> visual_features =
|
286
|
+
>>> visual_features = torch.rand(1, 1, 80, 80)
|
291
287
|
>>> pe = model.get_visual_pe(img, visual_features)
|
292
288
|
"""
|
293
289
|
assert isinstance(self.model, YOLOEModel)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
3
|
from pathlib import Path
|
4
|
-
from typing import Any, Dict, List, Tuple
|
4
|
+
from typing import Any, Dict, List, Tuple
|
5
5
|
|
6
6
|
import numpy as np
|
7
7
|
import torch
|
@@ -132,33 +132,14 @@ class OBBValidator(DetectionValidator):
|
|
132
132
|
ratio_pad = batch["ratio_pad"][si]
|
133
133
|
if len(cls):
|
134
134
|
bbox[..., :4].mul_(torch.tensor(imgsz, device=self.device)[[1, 0, 1, 0]]) # target boxes
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
input dimensions to the original image dimensions using the provided batch information.
|
144
|
-
|
145
|
-
Args:
|
146
|
-
pred (Dict[str, torch.Tensor]): Prediction dictionary containing bounding box coordinates and other information.
|
147
|
-
pbatch (Dict[str, Any]): Dictionary containing batch information with keys:
|
148
|
-
- imgsz (tuple): Model input image size.
|
149
|
-
- ori_shape (tuple): Original image shape.
|
150
|
-
- ratio_pad (tuple): Ratio and padding information for scaling.
|
151
|
-
|
152
|
-
Returns:
|
153
|
-
(Dict[str, torch.Tensor]): Scaled prediction dictionary with bounding boxes in original image dimensions.
|
154
|
-
"""
|
155
|
-
cls = pred["cls"]
|
156
|
-
if self.args.single_cls:
|
157
|
-
cls *= 0
|
158
|
-
bboxes = ops.scale_boxes(
|
159
|
-
pbatch["imgsz"], pred["bboxes"].clone(), pbatch["ori_shape"], ratio_pad=pbatch["ratio_pad"], xywh=True
|
160
|
-
) # native-space pred
|
161
|
-
return {"bboxes": bboxes, "conf": pred["conf"], "cls": cls}
|
135
|
+
return {
|
136
|
+
"cls": cls,
|
137
|
+
"bboxes": bbox,
|
138
|
+
"ori_shape": ori_shape,
|
139
|
+
"imgsz": imgsz,
|
140
|
+
"ratio_pad": ratio_pad,
|
141
|
+
"im_file": batch["im_file"][si],
|
142
|
+
}
|
162
143
|
|
163
144
|
def plot_predictions(self, batch: Dict[str, Any], preds: List[torch.Tensor], ni: int) -> None:
|
164
145
|
"""
|
@@ -180,23 +161,26 @@ class OBBValidator(DetectionValidator):
|
|
180
161
|
p["bboxes"][:, :4] = ops.xywh2xyxy(p["bboxes"][:, :4]) # convert to xyxy format for plotting
|
181
162
|
super().plot_predictions(batch, preds, ni) # plot bboxes
|
182
163
|
|
183
|
-
def pred_to_json(self, predn: Dict[str, torch.Tensor],
|
164
|
+
def pred_to_json(self, predn: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> None:
|
184
165
|
"""
|
185
166
|
Convert YOLO predictions to COCO JSON format with rotated bounding box information.
|
186
167
|
|
187
168
|
Args:
|
188
169
|
predn (Dict[str, torch.Tensor]): Prediction dictionary containing 'bboxes', 'conf', and 'cls' keys
|
189
170
|
with bounding box coordinates, confidence scores, and class predictions.
|
190
|
-
|
171
|
+
pbatch (Dict[str, Any]): Batch dictionary containing 'imgsz', 'ori_shape', 'ratio_pad', and 'im_file'.
|
191
172
|
|
192
173
|
Notes:
|
193
174
|
This method processes rotated bounding box predictions and converts them to both rbox format
|
194
175
|
(x, y, w, h, angle) and polygon format (x1, y1, x2, y2, x3, y3, x4, y4) before adding them
|
195
176
|
to the JSON dictionary.
|
196
177
|
"""
|
197
|
-
stem = Path(
|
178
|
+
stem = Path(pbatch["im_file"]).stem
|
198
179
|
image_id = int(stem) if stem.isnumeric() else stem
|
199
180
|
rbox = predn["bboxes"]
|
181
|
+
rbox = ops.scale_boxes(
|
182
|
+
pbatch["imgsz"], predn["bboxes"].clone(), pbatch["ori_shape"], ratio_pad=pbatch["ratio_pad"], xywh=True
|
183
|
+
) # native-space pred
|
200
184
|
poly = ops.xywhr2xyxyxyxy(rbox).view(-1, 8)
|
201
185
|
for r, b, s, c in zip(rbox.tolist(), poly.tolist(), predn["conf"].tolist(), predn["cls"].tolist()):
|
202
186
|
self.jdict.append(
|
@@ -167,34 +167,9 @@ class PoseValidator(DetectionValidator):
|
|
167
167
|
kpts = kpts.clone()
|
168
168
|
kpts[..., 0] *= w
|
169
169
|
kpts[..., 1] *= h
|
170
|
-
kpts = ops.scale_coords(pbatch["imgsz"], kpts, pbatch["ori_shape"], ratio_pad=pbatch["ratio_pad"])
|
171
170
|
pbatch["keypoints"] = kpts
|
172
171
|
return pbatch
|
173
172
|
|
174
|
-
def _prepare_pred(self, pred: Dict[str, Any], pbatch: Dict[str, Any]) -> Dict[str, Any]:
|
175
|
-
"""
|
176
|
-
Prepare and scale keypoints in predictions for pose processing.
|
177
|
-
|
178
|
-
This method extends the parent class's _prepare_pred method to handle keypoint scaling. It first calls
|
179
|
-
the parent method to get the basic prediction boxes, then extracts and scales the keypoint coordinates
|
180
|
-
to match the original image dimensions.
|
181
|
-
|
182
|
-
Args:
|
183
|
-
pred (Dict[str, torch.Tensor]): Post-processed predictions from the model.
|
184
|
-
pbatch (Dict[str, Any]): Processed batch dictionary containing image information including:
|
185
|
-
- imgsz: Image size used for inference
|
186
|
-
- ori_shape: Original image shape
|
187
|
-
- ratio_pad: Ratio and padding information for coordinate scaling
|
188
|
-
|
189
|
-
Returns:
|
190
|
-
(Dict[str, Any]): Processed prediction dictionary with keypoints scaled to original image dimensions.
|
191
|
-
"""
|
192
|
-
predn = super()._prepare_pred(pred, pbatch)
|
193
|
-
predn["keypoints"] = ops.scale_coords(
|
194
|
-
pbatch["imgsz"], pred.get("keypoints").clone(), pbatch["ori_shape"], ratio_pad=pbatch["ratio_pad"]
|
195
|
-
)
|
196
|
-
return predn
|
197
|
-
|
198
173
|
def _process_batch(self, preds: Dict[str, torch.Tensor], batch: Dict[str, Any]) -> Dict[str, np.ndarray]:
|
199
174
|
"""
|
200
175
|
Return correct prediction matrix by computing Intersection over Union (IoU) between detections and ground truth.
|
@@ -249,7 +224,7 @@ class PoseValidator(DetectionValidator):
|
|
249
224
|
keypoints=predn["keypoints"],
|
250
225
|
).save_txt(file, save_conf=save_conf)
|
251
226
|
|
252
|
-
def pred_to_json(self, predn: Dict[str, torch.Tensor],
|
227
|
+
def pred_to_json(self, predn: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> None:
|
253
228
|
"""
|
254
229
|
Convert YOLO predictions to COCO JSON format.
|
255
230
|
|
@@ -259,32 +234,22 @@ class PoseValidator(DetectionValidator):
|
|
259
234
|
Args:
|
260
235
|
predn (Dict[str, torch.Tensor]): Prediction dictionary containing 'bboxes', 'conf', 'cls',
|
261
236
|
and 'keypoints' tensors.
|
262
|
-
|
237
|
+
pbatch (Dict[str, Any]): Batch dictionary containing 'imgsz', 'ori_shape', 'ratio_pad', and 'im_file'.
|
263
238
|
|
264
239
|
Notes:
|
265
240
|
The method extracts the image ID from the filename stem (either as an integer if numeric, or as a string),
|
266
241
|
converts bounding boxes from xyxy to xywh format, and adjusts coordinates from center to top-left corner
|
267
242
|
before saving to the JSON dictionary.
|
268
243
|
"""
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
):
|
279
|
-
self.jdict.append(
|
280
|
-
{
|
281
|
-
"image_id": image_id,
|
282
|
-
"category_id": self.class_map[int(c)],
|
283
|
-
"bbox": [round(x, 3) for x in b],
|
284
|
-
"keypoints": k,
|
285
|
-
"score": round(s, 5),
|
286
|
-
}
|
287
|
-
)
|
244
|
+
super().pred_to_json(predn, pbatch)
|
245
|
+
kpts = ops.scale_coords(
|
246
|
+
pbatch["imgsz"],
|
247
|
+
predn["keypoints"].clone(),
|
248
|
+
pbatch["ori_shape"],
|
249
|
+
ratio_pad=pbatch["ratio_pad"],
|
250
|
+
)
|
251
|
+
for i, k in enumerate(kpts.flatten(1, 2).tolist()):
|
252
|
+
self.jdict[-len(kpts) + i]["keypoints"] = k # keypoints
|
288
253
|
|
289
254
|
def eval_json(self, stats: Dict[str, Any]) -> Dict[str, Any]:
|
290
255
|
"""Evaluate object detection model using COCO JSON format."""
|
@@ -135,29 +135,6 @@ class SegmentationValidator(DetectionValidator):
|
|
135
135
|
prepared_batch["masks"] = batch["masks"][midx]
|
136
136
|
return prepared_batch
|
137
137
|
|
138
|
-
def _prepare_pred(self, pred: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> Dict[str, torch.Tensor]:
|
139
|
-
"""
|
140
|
-
Prepare predictions for evaluation by processing bounding boxes and masks.
|
141
|
-
|
142
|
-
Args:
|
143
|
-
pred (Dict[str, torch.Tensor]): Post-processed predictions from the model.
|
144
|
-
pbatch (Dict[str, Any]): Prepared batch information.
|
145
|
-
|
146
|
-
Returns:
|
147
|
-
Dict[str, torch.Tensor]: Processed bounding box predictions.
|
148
|
-
"""
|
149
|
-
predn = super()._prepare_pred(pred, pbatch)
|
150
|
-
predn["masks"] = pred["masks"]
|
151
|
-
if self.args.save_json and len(predn["masks"]):
|
152
|
-
coco_masks = torch.as_tensor(pred["masks"], dtype=torch.uint8)
|
153
|
-
coco_masks = ops.scale_image(
|
154
|
-
coco_masks.permute(1, 2, 0).contiguous().cpu().numpy(),
|
155
|
-
pbatch["ori_shape"],
|
156
|
-
ratio_pad=pbatch["ratio_pad"],
|
157
|
-
)
|
158
|
-
predn["coco_masks"] = coco_masks
|
159
|
-
return predn
|
160
|
-
|
161
138
|
def _process_batch(self, preds: Dict[str, torch.Tensor], batch: Dict[str, Any]) -> Dict[str, np.ndarray]:
|
162
139
|
"""
|
163
140
|
Compute correct prediction matrix for a batch based on bounding boxes and optional masks.
|
@@ -233,13 +210,13 @@ class SegmentationValidator(DetectionValidator):
|
|
233
210
|
masks=torch.as_tensor(predn["masks"], dtype=torch.uint8),
|
234
211
|
).save_txt(file, save_conf=save_conf)
|
235
212
|
|
236
|
-
def pred_to_json(self, predn: torch.Tensor,
|
213
|
+
def pred_to_json(self, predn: Dict[str, torch.Tensor], pbatch: Dict[str, Any]) -> None:
|
237
214
|
"""
|
238
215
|
Save one JSON result for COCO evaluation.
|
239
216
|
|
240
217
|
Args:
|
241
218
|
predn (Dict[str, torch.Tensor]): Predictions containing bboxes, masks, confidence scores, and classes.
|
242
|
-
|
219
|
+
pbatch (Dict[str, Any]): Batch dictionary containing 'imgsz', 'ori_shape', 'ratio_pad', and 'im_file'.
|
243
220
|
|
244
221
|
Examples:
|
245
222
|
>>> result = {"image_id": 42, "category_id": 18, "bbox": [258.15, 41.29, 348.26, 243.78], "score": 0.236}
|
@@ -252,23 +229,18 @@ class SegmentationValidator(DetectionValidator):
|
|
252
229
|
rle["counts"] = rle["counts"].decode("utf-8")
|
253
230
|
return rle
|
254
231
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
232
|
+
coco_masks = torch.as_tensor(predn["masks"], dtype=torch.uint8)
|
233
|
+
coco_masks = ops.scale_image(
|
234
|
+
coco_masks.permute(1, 2, 0).contiguous().cpu().numpy(),
|
235
|
+
pbatch["ori_shape"],
|
236
|
+
ratio_pad=pbatch["ratio_pad"],
|
237
|
+
)
|
238
|
+
pred_masks = np.transpose(coco_masks, (2, 0, 1))
|
260
239
|
with ThreadPool(NUM_THREADS) as pool:
|
261
240
|
rles = pool.map(single_encode, pred_masks)
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
"image_id": image_id,
|
266
|
-
"category_id": self.class_map[int(c)],
|
267
|
-
"bbox": [round(x, 3) for x in b],
|
268
|
-
"score": round(s, 5),
|
269
|
-
"segmentation": rles[i],
|
270
|
-
}
|
271
|
-
)
|
241
|
+
super().pred_to_json(predn, pbatch)
|
242
|
+
for i, r in enumerate(rles):
|
243
|
+
self.jdict[-len(rles) + i]["segmentation"] = r # segmentation
|
272
244
|
|
273
245
|
def eval_json(self, stats: Dict[str, Any]) -> Dict[str, Any]:
|
274
246
|
"""Return COCO-style instance segmentation evaluation metrics."""
|
@@ -259,11 +259,7 @@ class AutoBackend(nn.Module):
|
|
259
259
|
session = onnxruntime.InferenceSession(w, providers=providers)
|
260
260
|
else:
|
261
261
|
check_requirements(
|
262
|
-
[
|
263
|
-
"model-compression-toolkit>=2.3.0,<2.4.1",
|
264
|
-
"sony-custom-layers[torch]>=0.3.0",
|
265
|
-
"onnxruntime-extensions",
|
266
|
-
]
|
262
|
+
["model-compression-toolkit>=2.4.1", "sony-custom-layers[torch]>=0.3.0", "onnxruntime-extensions"]
|
267
263
|
)
|
268
264
|
w = next(Path(w).glob("*.onnx"))
|
269
265
|
LOGGER.info(f"Loading {w} for ONNX IMX inference...")
|
@@ -273,7 +269,6 @@ class AutoBackend(nn.Module):
|
|
273
269
|
session_options = mctq.get_ort_session_options()
|
274
270
|
session_options.enable_mem_reuse = False # fix the shape mismatch from onnxruntime
|
275
271
|
session = onnxruntime.InferenceSession(w, session_options, providers=["CPUExecutionProvider"])
|
276
|
-
task = "detect"
|
277
272
|
|
278
273
|
output_names = [x.name for x in session.get_outputs()]
|
279
274
|
metadata = session.get_modelmeta().custom_metadata_map
|
@@ -674,8 +669,12 @@ class AutoBackend(nn.Module):
|
|
674
669
|
self.session.run_with_iobinding(self.io)
|
675
670
|
y = self.bindings
|
676
671
|
if self.imx:
|
677
|
-
|
678
|
-
|
672
|
+
if self.task == "detect":
|
673
|
+
# boxes, conf, cls
|
674
|
+
y = np.concatenate([y[0], y[1][:, :, None], y[2][:, :, None]], axis=-1)
|
675
|
+
elif self.task == "pose":
|
676
|
+
# boxes, conf, kpts
|
677
|
+
y = np.concatenate([y[0], y[1][:, :, None], y[2][:, :, None], y[3]], axis=-1)
|
679
678
|
|
680
679
|
# OpenVINO
|
681
680
|
elif self.xml:
|
@@ -178,14 +178,10 @@ class Detect(nn.Module):
|
|
178
178
|
grid_size = torch.tensor([grid_w, grid_h, grid_w, grid_h], device=box.device).reshape(1, 4, 1)
|
179
179
|
norm = self.strides / (self.stride[0] * grid_size)
|
180
180
|
dbox = self.decode_bboxes(self.dfl(box) * norm, self.anchors.unsqueeze(0) * norm[:, :2])
|
181
|
-
elif self.export and self.format == "imx":
|
182
|
-
dbox = self.decode_bboxes(
|
183
|
-
self.dfl(box) * self.strides, self.anchors.unsqueeze(0) * self.strides, xywh=False
|
184
|
-
)
|
185
|
-
return dbox.transpose(1, 2), cls.sigmoid().permute(0, 2, 1)
|
186
181
|
else:
|
187
182
|
dbox = self.decode_bboxes(self.dfl(box), self.anchors.unsqueeze(0)) * self.strides
|
188
|
-
|
183
|
+
if self.export and self.format == "imx":
|
184
|
+
return dbox.transpose(1, 2), cls.sigmoid().permute(0, 2, 1)
|
189
185
|
return torch.cat((dbox, cls.sigmoid()), 1)
|
190
186
|
|
191
187
|
def bias_init(self):
|
@@ -384,6 +380,8 @@ class Pose(Detect):
|
|
384
380
|
if self.training:
|
385
381
|
return x, kpt
|
386
382
|
pred_kpt = self.kpts_decode(bs, kpt)
|
383
|
+
if self.export and self.format == "imx":
|
384
|
+
return (*x, pred_kpt.permute(0, 2, 1))
|
387
385
|
return torch.cat([x, pred_kpt], 1) if self.export else (torch.cat([x[0], pred_kpt], 1), (x[1], kpt))
|
388
386
|
|
389
387
|
def kpts_decode(self, bs: int, kpts: torch.Tensor) -> torch.Tensor:
|