ultralytics 8.3.100__tar.gz → 8.3.102__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.100/ultralytics.egg-info → ultralytics-8.3.102}/PKG-INFO +1 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/pyproject.toml +0 -1
- ultralytics-8.3.102/tests/test_solutions.py +167 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/__init__.py +1 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/exporter.py +20 -5
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/model.py +1 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/predictor.py +3 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/hub/__init__.py +29 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/hub/google/__init__.py +18 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/fastsam/predict.py +12 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/nas/predict.py +21 -3
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/rtdetr/val.py +26 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/amg.py +22 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/encoders.py +85 -4
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/memory_attention.py +61 -3
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/utils.py +108 -5
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/utils/loss.py +38 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/utils/ops.py +15 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/classify/predict.py +11 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/classify/train.py +17 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/classify/val.py +82 -6
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/detect/predict.py +20 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/model.py +69 -4
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/obb/predict.py +16 -1
- ultralytics-8.3.102/ultralytics/models/yolo/obb/train.py +81 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/obb/val.py +87 -6
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/pose/predict.py +18 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/pose/train.py +48 -3
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/pose/val.py +113 -8
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/segment/predict.py +27 -2
- ultralytics-8.3.102/ultralytics/models/yolo/segment/train.py +123 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/segment/val.py +10 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/world/train_world.py +29 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/yoloe/train.py +47 -3
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/activation.py +26 -3
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/block.py +89 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/head.py +3 -92
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/utils.py +70 -4
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/tasks.py +2 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/text_model.py +93 -17
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/benchmarks.py +1 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/base.py +22 -5
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/comet.py +93 -5
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/dvc.py +64 -5
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/neptune.py +25 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/tensorboard.py +30 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/wb.py +16 -1
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/dist.py +35 -2
- ultralytics-8.3.102/ultralytics/utils/errors.py +43 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/patches.py +33 -5
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/triton.py +16 -3
- {ultralytics-8.3.100 → ultralytics-8.3.102/ultralytics.egg-info}/PKG-INFO +1 -2
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics.egg-info/requires.txt +0 -1
- ultralytics-8.3.100/tests/test_solutions.py +0 -103
- ultralytics-8.3.100/ultralytics/models/yolo/obb/train.py +0 -48
- ultralytics-8.3.100/ultralytics/models/yolo/segment/train.py +0 -65
- ultralytics-8.3.100/ultralytics/utils/errors.py +0 -22
- {ultralytics-8.3.100 → ultralytics-8.3.102}/LICENSE +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/README.md +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/setup.cfg +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/conftest.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/test_cli.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/test_cuda.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/test_engine.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/test_exports.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/test_integrations.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/tests/test_python.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/assets/bus.jpg +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/assets/zidane.jpg +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/VOC.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco128.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/coco8.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/dog-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/dota8.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/lvis.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/medical-pills.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/signature.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/datasets/xView.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/default.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yoloe-11-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/11/yoloe-11.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/12/yolo12-cls.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/12/yolo12-obb.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/12/yolo12-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/12/yolo12-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/12/yolo12.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yoloe-v8-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yoloe-v8.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/solutions/default.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/trackers/botsort.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/annotator.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/augment.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/base.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/build.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/converter.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/dataset.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/loaders.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/split_dota.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/data/utils.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/results.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/trainer.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/tuner.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/engine/validator.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/hub/auth.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/hub/session.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/hub/utils.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/fastsam/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/fastsam/model.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/fastsam/utils.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/fastsam/val.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/nas/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/nas/model.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/nas/val.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/rtdetr/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/rtdetr/model.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/rtdetr/predict.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/rtdetr/train.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/build.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/model.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/blocks.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/decoders.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/sam.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/modules/transformer.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/sam/predict.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/utils/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/classify/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/detect/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/detect/train.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/detect/val.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/obb/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/pose/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/segment/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/world/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/world/train.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/yoloe/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/yoloe/predict.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/yoloe/train_seg.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/models/yolo/yoloe/val.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/autobackend.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/conv.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/nn/modules/transformer.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/ai_gym.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/analytics.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/distance_calculation.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/heatmap.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/instance_segmentation.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/object_blurrer.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/object_counter.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/object_cropper.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/parking_management.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/queue_management.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/region_counter.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/security_alarm.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/solutions.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/speed_estimation.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/streamlit_inference.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/trackzone.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/solutions/vision_eye.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/basetrack.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/bot_sort.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/byte_tracker.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/track.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/utils/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/utils/gmc.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/utils/kalman_filter.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/trackers/utils/matching.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/autobatch.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/__init__.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/clearml.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/hub.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/mlflow.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/callbacks/raytune.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/checks.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/downloads.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/files.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/instance.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/loss.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/metrics.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/ops.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/plotting.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/tal.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/torch_utils.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics/utils/tuner.py +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics.egg-info/SOURCES.txt +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics.egg-info/dependency_links.txt +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/ultralytics.egg-info/entry_points.txt +0 -0
- {ultralytics-8.3.100 → ultralytics-8.3.102}/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.102
|
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>
|
@@ -56,7 +56,6 @@ Requires-Dist: coverage[toml]; extra == "dev"
|
|
56
56
|
Requires-Dist: mkdocs>=1.6.0; extra == "dev"
|
57
57
|
Requires-Dist: mkdocs-material>=9.5.9; extra == "dev"
|
58
58
|
Requires-Dist: mkdocstrings[python]; extra == "dev"
|
59
|
-
Requires-Dist: mkdocs-redirects; extra == "dev"
|
60
59
|
Requires-Dist: mkdocs-ultralytics-plugin>=0.1.17; extra == "dev"
|
61
60
|
Requires-Dist: mkdocs-macros-plugin>=1.0.5; extra == "dev"
|
62
61
|
Provides-Extra: export
|
@@ -89,7 +89,6 @@ dev = [
|
|
89
89
|
"mkdocs>=1.6.0",
|
90
90
|
"mkdocs-material>=9.5.9",
|
91
91
|
"mkdocstrings[python]",
|
92
|
-
"mkdocs-redirects", # 301 redirects
|
93
92
|
"mkdocs-ultralytics-plugin>=0.1.17", # for meta descriptions and images, dates and authors
|
94
93
|
"mkdocs-macros-plugin>=1.0.5" # duplicating content (i.e. export tables) in multiple places
|
95
94
|
]
|
@@ -0,0 +1,167 @@
|
|
1
|
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
|
+
|
3
|
+
# Tests Ultralytics Solutions: https://docs.ultralytics.com/solutions/,
|
4
|
+
# including every solution excluding DistanceCalculation and Security Alarm System.
|
5
|
+
|
6
|
+
import cv2
|
7
|
+
import pytest
|
8
|
+
|
9
|
+
from tests import TMP
|
10
|
+
from ultralytics import solutions
|
11
|
+
from ultralytics.utils import ASSETS_URL
|
12
|
+
from ultralytics.utils.downloads import safe_download
|
13
|
+
|
14
|
+
# Pre-defined arguments values
|
15
|
+
SHOW = False
|
16
|
+
DEMO_VIDEO = "solutions_ci_demo.mp4" # for all the solutions, except workout, object cropping and parking management
|
17
|
+
CROP_VIDEO = "decelera_landscape_min.mov" # for object cropping solution
|
18
|
+
POSE_VIDEO = "solution_ci_pose_demo.mp4" # only for workouts monitoring solution
|
19
|
+
PARKING_VIDEO = "solution_ci_parking_demo.mp4" # only for parking management solution
|
20
|
+
PARKING_AREAS_JSON = "solution_ci_parking_areas.json" # only for parking management solution
|
21
|
+
PARKING_MODEL = "solutions_ci_parking_model.pt" # only for parking management solution
|
22
|
+
MODEL_FILE = "yolo11n.pt" # model file used for solutions, except parking management and instance segmentation
|
23
|
+
REGION = [(20, 400), (1080, 400), (1080, 360), (20, 360)] # for object counting, speed estimation and queue management
|
24
|
+
|
25
|
+
# Test configs for each solution : (name, class, needs_frame_count, video, kwargs)
|
26
|
+
SOLUTIONS = [
|
27
|
+
(
|
28
|
+
"ObjectCounter",
|
29
|
+
solutions.ObjectCounter,
|
30
|
+
False,
|
31
|
+
DEMO_VIDEO,
|
32
|
+
{"region": REGION, "model": MODEL_FILE, "show": SHOW},
|
33
|
+
),
|
34
|
+
(
|
35
|
+
"Heatmap",
|
36
|
+
solutions.Heatmap,
|
37
|
+
False,
|
38
|
+
DEMO_VIDEO,
|
39
|
+
{"colormap": cv2.COLORMAP_PARULA, "model": MODEL_FILE, "show": SHOW, "region": None},
|
40
|
+
),
|
41
|
+
(
|
42
|
+
"HeatmapWithRegion",
|
43
|
+
solutions.Heatmap,
|
44
|
+
False,
|
45
|
+
DEMO_VIDEO,
|
46
|
+
{"colormap": cv2.COLORMAP_PARULA, "region": REGION, "model": MODEL_FILE, "show": SHOW},
|
47
|
+
),
|
48
|
+
(
|
49
|
+
"SpeedEstimator",
|
50
|
+
solutions.SpeedEstimator,
|
51
|
+
False,
|
52
|
+
DEMO_VIDEO,
|
53
|
+
{"region": REGION, "model": MODEL_FILE, "show": SHOW},
|
54
|
+
),
|
55
|
+
(
|
56
|
+
"QueueManager",
|
57
|
+
solutions.QueueManager,
|
58
|
+
False,
|
59
|
+
DEMO_VIDEO,
|
60
|
+
{"region": REGION, "model": MODEL_FILE, "show": SHOW},
|
61
|
+
),
|
62
|
+
(
|
63
|
+
"LineAnalytics",
|
64
|
+
solutions.Analytics,
|
65
|
+
True,
|
66
|
+
DEMO_VIDEO,
|
67
|
+
{"analytics_type": "line", "model": MODEL_FILE, "show": SHOW},
|
68
|
+
),
|
69
|
+
(
|
70
|
+
"PieAnalytics",
|
71
|
+
solutions.Analytics,
|
72
|
+
True,
|
73
|
+
DEMO_VIDEO,
|
74
|
+
{"analytics_type": "pie", "model": MODEL_FILE, "show": SHOW},
|
75
|
+
),
|
76
|
+
(
|
77
|
+
"BarAnalytics",
|
78
|
+
solutions.Analytics,
|
79
|
+
True,
|
80
|
+
DEMO_VIDEO,
|
81
|
+
{"analytics_type": "bar", "model": MODEL_FILE, "show": SHOW},
|
82
|
+
),
|
83
|
+
(
|
84
|
+
"AreaAnalytics",
|
85
|
+
solutions.Analytics,
|
86
|
+
True,
|
87
|
+
DEMO_VIDEO,
|
88
|
+
{"analytics_type": "area", "model": MODEL_FILE, "show": SHOW},
|
89
|
+
),
|
90
|
+
("TrackZone", solutions.TrackZone, False, DEMO_VIDEO, {"region": REGION, "model": MODEL_FILE, "show": SHOW}),
|
91
|
+
(
|
92
|
+
"ObjectCropper",
|
93
|
+
solutions.ObjectCropper,
|
94
|
+
False,
|
95
|
+
CROP_VIDEO,
|
96
|
+
{"crop_dir": str(TMP / "cropped-detections"), "model": MODEL_FILE, "show": SHOW},
|
97
|
+
),
|
98
|
+
(
|
99
|
+
"ObjectBlurrer",
|
100
|
+
solutions.ObjectBlurrer,
|
101
|
+
False,
|
102
|
+
DEMO_VIDEO,
|
103
|
+
{"blur_ratio": 0.5, "model": MODEL_FILE, "show": SHOW},
|
104
|
+
),
|
105
|
+
(
|
106
|
+
"InstanceSegmentation",
|
107
|
+
solutions.InstanceSegmentation,
|
108
|
+
False,
|
109
|
+
DEMO_VIDEO,
|
110
|
+
{"model": "yolo11n-seg.pt", "show": SHOW},
|
111
|
+
),
|
112
|
+
("VisionEye", solutions.VisionEye, False, DEMO_VIDEO, {"model": MODEL_FILE, "show": SHOW}),
|
113
|
+
(
|
114
|
+
"RegionCounter",
|
115
|
+
solutions.RegionCounter,
|
116
|
+
False,
|
117
|
+
DEMO_VIDEO,
|
118
|
+
{"region": REGION, "model": MODEL_FILE, "show": SHOW},
|
119
|
+
),
|
120
|
+
("AIGym", solutions.AIGym, False, POSE_VIDEO, {"kpts": [6, 8, 10], "show": SHOW}),
|
121
|
+
(
|
122
|
+
"ParkingManager",
|
123
|
+
solutions.ParkingManagement,
|
124
|
+
False,
|
125
|
+
PARKING_VIDEO,
|
126
|
+
{"model": str(TMP / PARKING_MODEL), "show": SHOW, "json_file": str(TMP / PARKING_AREAS_JSON)},
|
127
|
+
),
|
128
|
+
(
|
129
|
+
"StreamlitInference",
|
130
|
+
solutions.Inference,
|
131
|
+
False,
|
132
|
+
None, # streamlit application don't require video file
|
133
|
+
{}, # streamlit application don't accept arguments
|
134
|
+
),
|
135
|
+
]
|
136
|
+
|
137
|
+
|
138
|
+
def process_video(solution, video_path, needs_frame_count=False):
|
139
|
+
"""Process video with solution, feeding frames and optional frame count."""
|
140
|
+
cap = cv2.VideoCapture(video_path)
|
141
|
+
assert cap.isOpened(), f"Error reading video file {video_path}"
|
142
|
+
|
143
|
+
frame_count = 0
|
144
|
+
while cap.isOpened():
|
145
|
+
success, im0 = cap.read()
|
146
|
+
if not success:
|
147
|
+
break
|
148
|
+
frame_count += 1
|
149
|
+
im_copy = im0.copy()
|
150
|
+
args = [im_copy, frame_count] if needs_frame_count else [im_copy]
|
151
|
+
_ = solution(*args)
|
152
|
+
|
153
|
+
cap.release()
|
154
|
+
|
155
|
+
|
156
|
+
@pytest.mark.slow
|
157
|
+
@pytest.mark.parametrize("name, solution_class, needs_frame_count, video, kwargs", SOLUTIONS)
|
158
|
+
def test_solution(name, solution_class, needs_frame_count, video, kwargs):
|
159
|
+
"""Test individual Ultralytics solution."""
|
160
|
+
safe_download(url=f"{ASSETS_URL}/{video}", dir=TMP)
|
161
|
+
if name == "ParkingManager":
|
162
|
+
safe_download(url=f"{ASSETS_URL}/{PARKING_AREAS_JSON}", dir=TMP)
|
163
|
+
safe_download(url=f"{ASSETS_URL}/{PARKING_MODEL}", dir=TMP)
|
164
|
+
solution = solution_class(**kwargs)
|
165
|
+
solution.inference() if name == "StreamlitInference" else process_video(
|
166
|
+
solution, str(TMP / video), needs_frame_count
|
167
|
+
)
|
@@ -115,18 +115,32 @@ def export_formats():
|
|
115
115
|
["PyTorch", "-", ".pt", True, True, []],
|
116
116
|
["TorchScript", "torchscript", ".torchscript", True, True, ["batch", "optimize", "nms"]],
|
117
117
|
["ONNX", "onnx", ".onnx", True, True, ["batch", "dynamic", "half", "opset", "simplify", "nms"]],
|
118
|
-
[
|
119
|
-
|
118
|
+
[
|
119
|
+
"OpenVINO",
|
120
|
+
"openvino",
|
121
|
+
"_openvino_model",
|
122
|
+
True,
|
123
|
+
False,
|
124
|
+
["batch", "dynamic", "half", "int8", "nms", "fraction"],
|
125
|
+
],
|
126
|
+
[
|
127
|
+
"TensorRT",
|
128
|
+
"engine",
|
129
|
+
".engine",
|
130
|
+
False,
|
131
|
+
True,
|
132
|
+
["batch", "dynamic", "half", "int8", "simplify", "nms", "fraction"],
|
133
|
+
],
|
120
134
|
["CoreML", "coreml", ".mlpackage", True, False, ["batch", "half", "int8", "nms"]],
|
121
135
|
["TensorFlow SavedModel", "saved_model", "_saved_model", True, True, ["batch", "int8", "keras", "nms"]],
|
122
136
|
["TensorFlow GraphDef", "pb", ".pb", True, True, ["batch"]],
|
123
|
-
["TensorFlow Lite", "tflite", ".tflite", True, False, ["batch", "half", "int8", "nms"]],
|
137
|
+
["TensorFlow Lite", "tflite", ".tflite", True, False, ["batch", "half", "int8", "nms", "fraction"]],
|
124
138
|
["TensorFlow Edge TPU", "edgetpu", "_edgetpu.tflite", True, False, []],
|
125
139
|
["TensorFlow.js", "tfjs", "_web_model", True, False, ["batch", "half", "int8", "nms"]],
|
126
140
|
["PaddlePaddle", "paddle", "_paddle_model", True, True, ["batch"]],
|
127
141
|
["MNN", "mnn", ".mnn", True, True, ["batch", "half", "int8"]],
|
128
142
|
["NCNN", "ncnn", "_ncnn_model", True, True, ["batch", "half"]],
|
129
|
-
["IMX", "imx", "_imx_model", True, True, ["int8"]],
|
143
|
+
["IMX", "imx", "_imx_model", True, True, ["int8", "fraction"]],
|
130
144
|
["RKNN", "rknn", "_rknn_model", False, False, ["batch", "name"]],
|
131
145
|
]
|
132
146
|
return dict(zip(["Format", "Argument", "Suffix", "CPU", "GPU", "Arguments"], zip(*x)))
|
@@ -144,7 +158,7 @@ def validate_args(format, passed_args, valid_args):
|
|
144
158
|
Raises:
|
145
159
|
AssertionError: If an unsupported argument is used, or if the format lacks supported argument listings.
|
146
160
|
"""
|
147
|
-
export_args = ["half", "int8", "dynamic", "keras", "nms", "batch"]
|
161
|
+
export_args = ["half", "int8", "dynamic", "keras", "nms", "batch", "fraction"]
|
148
162
|
|
149
163
|
assert valid_args is not None, f"ERROR ❌️ valid arguments for '{format}' not listed."
|
150
164
|
custom = {"batch": 1, "data": None, "device": None} # exporter defaults
|
@@ -493,6 +507,7 @@ class Exporter:
|
|
493
507
|
dataset = YOLODataset(
|
494
508
|
data[self.args.split or "val"],
|
495
509
|
data=data,
|
510
|
+
fraction=self.args.fraction,
|
496
511
|
task=self.model.task,
|
497
512
|
imgsz=self.imgsz[0],
|
498
513
|
augment=False,
|
@@ -534,7 +534,7 @@ class Model(torch.nn.Module):
|
|
534
534
|
x in ARGV for x in ("predict", "track", "mode=predict", "mode=track")
|
535
535
|
)
|
536
536
|
|
537
|
-
custom = {"conf": 0.25, "batch": 1, "save": is_cli, "mode": "predict"} # method defaults
|
537
|
+
custom = {"conf": 0.25, "batch": 1, "save": is_cli, "mode": "predict", "rect": True} # method defaults
|
538
538
|
args = {**self.overrides, **custom, **kwargs} # highest priority args on the right
|
539
539
|
prompts = args.pop("prompts", None) # for SAM-type models
|
540
540
|
|
@@ -183,7 +183,9 @@ class BasePredictor:
|
|
183
183
|
same_shapes = len({x.shape for x in im}) == 1
|
184
184
|
letterbox = LetterBox(
|
185
185
|
self.imgsz,
|
186
|
-
auto=same_shapes
|
186
|
+
auto=same_shapes
|
187
|
+
and self.args.rect
|
188
|
+
and (self.model.pt or (getattr(self.model, "dynamic", False) and not self.model.imx)),
|
187
189
|
stride=self.model.stride,
|
188
190
|
)
|
189
191
|
return [letterbox(image=x) for x in im]
|
@@ -96,7 +96,21 @@ def export_fmts_hub():
|
|
96
96
|
|
97
97
|
|
98
98
|
def export_model(model_id: str = "", format: str = "torchscript"):
|
99
|
-
"""
|
99
|
+
"""
|
100
|
+
Export a model to a specified format for deployment via the Ultralytics HUB API.
|
101
|
+
|
102
|
+
Args:
|
103
|
+
model_id (str): The ID of the model to export. An empty string will use the default model.
|
104
|
+
format (str): The format to export the model to. Must be one of the supported formats returned by
|
105
|
+
export_fmts_hub().
|
106
|
+
|
107
|
+
Raises:
|
108
|
+
AssertionError: If the specified format is not supported or if the export request fails.
|
109
|
+
|
110
|
+
Examples:
|
111
|
+
>>> from ultralytics import hub
|
112
|
+
>>> hub.export_model(model_id="your_model_id", format="torchscript")
|
113
|
+
"""
|
100
114
|
assert format in export_fmts_hub(), f"Unsupported export format '{format}', valid formats are {export_fmts_hub()}"
|
101
115
|
r = requests.post(
|
102
116
|
f"{HUB_API_ROOT}/v1/models/{model_id}/export", json={"format": format}, headers={"x-api-key": Auth().api_key}
|
@@ -106,7 +120,20 @@ def export_model(model_id: str = "", format: str = "torchscript"):
|
|
106
120
|
|
107
121
|
|
108
122
|
def get_export(model_id: str = "", format: str = "torchscript"):
|
109
|
-
"""
|
123
|
+
"""
|
124
|
+
Retrieve an exported model in the specified format from Ultralytics HUB using the model ID.
|
125
|
+
|
126
|
+
Args:
|
127
|
+
model_id (str): The ID of the model to retrieve from Ultralytics HUB.
|
128
|
+
format (str): The export format to retrieve. Must be one of the supported formats returned by export_fmts_hub().
|
129
|
+
|
130
|
+
Raises:
|
131
|
+
AssertionError: If the specified format is not supported or if the API request fails.
|
132
|
+
|
133
|
+
Examples:
|
134
|
+
>>> from ultralytics import hub
|
135
|
+
>>> hub.get_export(model_id="your_model_id", format="torchscript")
|
136
|
+
"""
|
110
137
|
assert format in export_fmts_hub(), f"Unsupported export format '{format}', valid formats are {export_fmts_hub()}"
|
111
138
|
r = requests.post(
|
112
139
|
f"{HUB_API_ROOT}/get-export",
|
@@ -83,7 +83,24 @@ class GCPRegions:
|
|
83
83
|
|
84
84
|
@staticmethod
|
85
85
|
def _ping_region(region: str, attempts: int = 1) -> Tuple[str, float, float, float, float]:
|
86
|
-
"""
|
86
|
+
"""
|
87
|
+
Ping a specified GCP region and measure network latency statistics.
|
88
|
+
|
89
|
+
Args:
|
90
|
+
region (str): The GCP region identifier to ping (e.g., 'us-central1').
|
91
|
+
attempts (int): Number of ping attempts to make for calculating statistics.
|
92
|
+
|
93
|
+
Returns:
|
94
|
+
region (str): The GCP region identifier that was pinged.
|
95
|
+
mean_latency (float): Mean latency in milliseconds, or infinity if all pings failed.
|
96
|
+
min_latency (float): Minimum latency in milliseconds, or infinity if all pings failed.
|
97
|
+
max_latency (float): Maximum latency in milliseconds, or infinity if all pings failed.
|
98
|
+
std_dev (float): Standard deviation of latencies in milliseconds, or infinity if all pings failed.
|
99
|
+
|
100
|
+
Examples:
|
101
|
+
>>> region, mean, min_lat, max_lat, std = GCPRegions._ping_region("us-central1", attempts=3)
|
102
|
+
>>> print(f"Region {region} has mean latency: {mean:.2f}ms")
|
103
|
+
"""
|
87
104
|
url = f"https://{region}-docker.pkg.dev"
|
88
105
|
latencies = []
|
89
106
|
for _ in range(attempts):
|
@@ -33,7 +33,18 @@ class FastSAMPredictor(SegmentationPredictor):
|
|
33
33
|
"""
|
34
34
|
|
35
35
|
def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None):
|
36
|
-
"""
|
36
|
+
"""
|
37
|
+
Initialize the FastSAMPredictor with configuration and callbacks.
|
38
|
+
|
39
|
+
This initializes a predictor specialized for Fast SAM (Segment Anything Model) segmentation tasks. The predictor
|
40
|
+
extends SegmentationPredictor with custom post-processing for mask prediction and non-maximum suppression
|
41
|
+
optimized for single-class segmentation.
|
42
|
+
|
43
|
+
Args:
|
44
|
+
cfg (dict): Configuration for the predictor. Defaults to Ultralytics DEFAULT_CFG.
|
45
|
+
overrides (dict, optional): Configuration overrides.
|
46
|
+
_callbacks (list, optional): List of callback functions.
|
47
|
+
"""
|
37
48
|
super().__init__(cfg, overrides, _callbacks)
|
38
49
|
self.prompts = {}
|
39
50
|
|
@@ -33,8 +33,26 @@ class NASPredictor(DetectionPredictor):
|
|
33
33
|
"""
|
34
34
|
|
35
35
|
def postprocess(self, preds_in, img, orig_imgs):
|
36
|
-
"""
|
37
|
-
|
36
|
+
"""
|
37
|
+
Postprocess NAS model predictions to generate final detection results.
|
38
|
+
|
39
|
+
This method takes raw predictions from a YOLO NAS model, converts bounding box formats, and applies
|
40
|
+
post-processing operations to generate the final detection results compatible with Ultralytics
|
41
|
+
result visualization and analysis tools.
|
42
|
+
|
43
|
+
Args:
|
44
|
+
preds_in (list): Raw predictions from the NAS model, typically containing bounding boxes and class scores.
|
45
|
+
img (torch.Tensor): Input image tensor that was fed to the model, with shape (B, C, H, W).
|
46
|
+
orig_imgs (list | torch.Tensor | np.ndarray): Original images before preprocessing, used for scaling
|
47
|
+
coordinates back to original dimensions.
|
48
|
+
|
49
|
+
Returns:
|
50
|
+
(list): List of Results objects containing the processed predictions for each image in the batch.
|
51
|
+
|
52
|
+
Examples:
|
53
|
+
>>> predictor = NAS("yolo_nas_s").predictor
|
54
|
+
>>> results = predictor.postprocess(raw_preds, img, orig_imgs)
|
55
|
+
"""
|
38
56
|
boxes = ops.xyxy2xywh(preds_in[0][0])
|
39
|
-
preds = torch.cat((boxes, preds_in[0][1]), -1).permute(0, 2, 1)
|
57
|
+
preds = torch.cat((boxes, preds_in[0][1]), -1).permute(0, 2, 1) # concatenate with class scores
|
40
58
|
return super().postprocess(preds, img, orig_imgs)
|
@@ -19,11 +19,35 @@ class RTDETRDataset(YOLODataset):
|
|
19
19
|
"""
|
20
20
|
|
21
21
|
def __init__(self, *args, data=None, **kwargs):
|
22
|
-
"""
|
22
|
+
"""
|
23
|
+
Initialize the RTDETRDataset class by inheriting from the YOLODataset class.
|
24
|
+
|
25
|
+
This constructor sets up a dataset specifically optimized for the RT-DETR (Real-Time DEtection and TRacking)
|
26
|
+
model, building upon the base YOLODataset functionality.
|
27
|
+
|
28
|
+
Args:
|
29
|
+
*args (Any): Variable length argument list passed to the parent YOLODataset class.
|
30
|
+
data (Dict | None): Dictionary containing dataset information. If None, default values will be used.
|
31
|
+
**kwargs (Any): Additional keyword arguments passed to the parent YOLODataset class.
|
32
|
+
"""
|
23
33
|
super().__init__(*args, data=data, **kwargs)
|
24
34
|
|
25
35
|
def load_image(self, i, rect_mode=False):
|
26
|
-
"""
|
36
|
+
"""
|
37
|
+
Load one image from dataset index 'i'.
|
38
|
+
|
39
|
+
Args:
|
40
|
+
i (int): Index of the image to load.
|
41
|
+
rect_mode (bool, optional): Whether to use rectangular mode for batch inference.
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
im (numpy.ndarray): The loaded image.
|
45
|
+
resized_hw (tuple): Height and width of the resized image with shape (2,).
|
46
|
+
|
47
|
+
Examples:
|
48
|
+
>>> dataset = RTDETRDataset(...)
|
49
|
+
>>> image, hw = dataset.load_image(0)
|
50
|
+
"""
|
27
51
|
return super().load_image(i=i, rect_mode=rect_mode)
|
28
52
|
|
29
53
|
def build_transforms(self, hyp=None):
|
@@ -22,7 +22,28 @@ def is_box_near_crop_edge(
|
|
22
22
|
|
23
23
|
|
24
24
|
def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None, None]:
|
25
|
-
"""
|
25
|
+
"""
|
26
|
+
Yield batches of data from input arguments with specified batch size for efficient processing.
|
27
|
+
|
28
|
+
This function takes a batch size and any number of iterables, then yields batches of elements from those
|
29
|
+
iterables. All input iterables must have the same length.
|
30
|
+
|
31
|
+
Args:
|
32
|
+
batch_size (int): Size of each batch to yield.
|
33
|
+
*args (Any): Variable length input iterables to batch. All iterables must have the same length.
|
34
|
+
|
35
|
+
Yields:
|
36
|
+
(List[Any]): A list of batched elements from each input iterable.
|
37
|
+
|
38
|
+
Examples:
|
39
|
+
>>> data = [1, 2, 3, 4, 5]
|
40
|
+
>>> labels = ["a", "b", "c", "d", "e"]
|
41
|
+
>>> for batch in batch_iterator(2, data, labels):
|
42
|
+
... print(batch)
|
43
|
+
[[1, 2], ['a', 'b']]
|
44
|
+
[[3, 4], ['c', 'd']]
|
45
|
+
[[5], ['e']]
|
46
|
+
"""
|
26
47
|
assert args and all(len(a) == len(args[0]) for a in args), "Batched iteration must have same-size inputs."
|
27
48
|
n_batches = len(args[0]) // batch_size + int(len(args[0]) % batch_size != 0)
|
28
49
|
for b in range(n_batches):
|
@@ -386,7 +386,24 @@ class MemoryEncoder(nn.Module):
|
|
386
386
|
out_dim,
|
387
387
|
in_dim=256, # in_dim of pix_feats
|
388
388
|
):
|
389
|
-
"""
|
389
|
+
"""
|
390
|
+
Initialize the MemoryEncoder for encoding pixel features and masks into memory representations.
|
391
|
+
|
392
|
+
This encoder processes pixel-level features and masks, fusing them to generate encoded memory representations
|
393
|
+
suitable for downstream tasks in image segmentation models like SAM (Segment Anything Model).
|
394
|
+
|
395
|
+
Args:
|
396
|
+
out_dim (int): Output dimension of the encoded features.
|
397
|
+
in_dim (int): Input dimension of the pixel features. Default is 256.
|
398
|
+
|
399
|
+
Examples:
|
400
|
+
>>> encoder = MemoryEncoder(out_dim=256, in_dim=256)
|
401
|
+
>>> pix_feat = torch.randn(1, 256, 64, 64)
|
402
|
+
>>> masks = torch.randn(1, 1, 64, 64)
|
403
|
+
>>> encoded_feat, pos = encoder(pix_feat, masks)
|
404
|
+
>>> print(encoded_feat.shape, pos.shape)
|
405
|
+
torch.Size([1, 256, 64, 64]) torch.Size([1, 128, 64, 64])
|
406
|
+
"""
|
390
407
|
super().__init__()
|
391
408
|
|
392
409
|
self.mask_downsampler = MaskDownSampler(kernel_size=3, stride=2, padding=1)
|
@@ -453,7 +470,26 @@ class ImageEncoder(nn.Module):
|
|
453
470
|
neck: nn.Module,
|
454
471
|
scalp: int = 0,
|
455
472
|
):
|
456
|
-
"""
|
473
|
+
"""
|
474
|
+
Initialize the ImageEncoder with trunk and neck networks for feature extraction and refinement.
|
475
|
+
|
476
|
+
This encoder combines a trunk network for feature extraction with a neck network for feature refinement
|
477
|
+
and positional encoding generation. It can optionally discard the lowest resolution features.
|
478
|
+
|
479
|
+
Args:
|
480
|
+
trunk (nn.Module): The trunk network for initial feature extraction.
|
481
|
+
neck (nn.Module): The neck network for feature refinement and positional encoding generation.
|
482
|
+
scalp (int): Number of lowest resolution feature levels to discard.
|
483
|
+
|
484
|
+
Examples:
|
485
|
+
>>> trunk = SomeTrunkNetwork()
|
486
|
+
>>> neck = SomeNeckNetwork()
|
487
|
+
>>> encoder = ImageEncoder(trunk, neck, scalp=1)
|
488
|
+
>>> image = torch.randn(1, 3, 224, 224)
|
489
|
+
>>> output = encoder(image)
|
490
|
+
>>> print(output.keys())
|
491
|
+
dict_keys(['vision_features', 'vision_pos_enc', 'backbone_fpn'])
|
492
|
+
"""
|
457
493
|
super().__init__()
|
458
494
|
self.trunk = trunk
|
459
495
|
self.neck = neck
|
@@ -681,7 +717,34 @@ class Hiera(nn.Module):
|
|
681
717
|
),
|
682
718
|
return_interm_layers=True, # return feats from every stage
|
683
719
|
):
|
684
|
-
"""
|
720
|
+
"""
|
721
|
+
Initialize a Hiera model, a hierarchical vision transformer for efficient multiscale feature extraction.
|
722
|
+
|
723
|
+
Hiera is a hierarchical vision transformer architecture designed for efficient multiscale feature extraction
|
724
|
+
in image processing tasks. It uses a series of transformer blocks organized into stages, with optional
|
725
|
+
pooling and global attention mechanisms.
|
726
|
+
|
727
|
+
Args:
|
728
|
+
embed_dim (int): Initial embedding dimension for the model.
|
729
|
+
num_heads (int): Initial number of attention heads.
|
730
|
+
drop_path_rate (float): Stochastic depth rate.
|
731
|
+
q_pool (int): Number of query pooling stages.
|
732
|
+
q_stride (Tuple[int, int]): Downsampling stride between stages.
|
733
|
+
stages (Tuple[int, ...]): Number of blocks per stage.
|
734
|
+
dim_mul (float): Dimension multiplier factor at stage transitions.
|
735
|
+
head_mul (float): Head multiplier factor at stage transitions.
|
736
|
+
window_pos_embed_bkg_spatial_size (Tuple[int, int]): Spatial size for window positional embedding background.
|
737
|
+
window_spec (Tuple[int, ...]): Window sizes for each stage when not using global attention.
|
738
|
+
global_att_blocks (Tuple[int, ...]): Indices of blocks that use global attention.
|
739
|
+
return_interm_layers (bool): Whether to return intermediate layer outputs.
|
740
|
+
|
741
|
+
Examples:
|
742
|
+
>>> model = Hiera(embed_dim=96, num_heads=1, stages=(2, 3, 16, 3))
|
743
|
+
>>> input_tensor = torch.randn(1, 3, 224, 224)
|
744
|
+
>>> output_features = model(input_tensor)
|
745
|
+
>>> for feat in output_features:
|
746
|
+
... print(feat.shape)
|
747
|
+
"""
|
685
748
|
super().__init__()
|
686
749
|
|
687
750
|
assert len(stages) == len(window_spec)
|
@@ -756,7 +819,25 @@ class Hiera(nn.Module):
|
|
756
819
|
return pos_embed
|
757
820
|
|
758
821
|
def forward(self, x: torch.Tensor) -> List[torch.Tensor]:
|
759
|
-
"""
|
822
|
+
"""
|
823
|
+
Perform forward pass through Hiera model, extracting multiscale features from input images.
|
824
|
+
|
825
|
+
Args:
|
826
|
+
x (torch.Tensor): Input tensor with shape (B, C, H, W) representing a batch of images.
|
827
|
+
|
828
|
+
Returns:
|
829
|
+
(List[torch.Tensor]): List of feature maps at different scales, each with shape (B, C_i, H_i, W_i), where
|
830
|
+
C_i is the channel dimension and H_i, W_i are the spatial dimensions at scale i. The list is ordered
|
831
|
+
from highest resolution (fine features) to lowest resolution (coarse features) if return_interm_layers
|
832
|
+
is True, otherwise contains only the final output.
|
833
|
+
|
834
|
+
Examples:
|
835
|
+
>>> model = Hiera(embed_dim=96, num_heads=1, stages=(2, 3, 16, 3))
|
836
|
+
>>> input_tensor = torch.randn(1, 3, 224, 224)
|
837
|
+
>>> output_features = model(input_tensor)
|
838
|
+
>>> for feat in output_features:
|
839
|
+
... print(feat.shape)
|
840
|
+
"""
|
760
841
|
x = self.patch_embed(x)
|
761
842
|
# x: (B, H, W, C)
|
762
843
|
|