ultralytics 8.2.59__tar.gz → 8.2.61__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.
Potentially problematic release.
This version of ultralytics might be problematic. Click here for more details.
- {ultralytics-8.2.59/ultralytics.egg-info → ultralytics-8.2.61}/PKG-INFO +1 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/__init__.py +1 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/__init__.py +200 -110
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/dataset.py +2 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/explorer/explorer.py +4 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/exporter.py +1 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/model.py +7 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/fastsam/prompt.py +2 -2
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/detect/val.py +5 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/segment/val.py +1 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/modules/block.py +2 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/modules/head.py +2 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/parking_management.py +4 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/benchmarks.py +2 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/loss.py +3 -5
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/metrics.py +2 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/ops.py +0 -21
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/tal.py +2 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/torch_utils.py +3 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61/ultralytics.egg-info}/PKG-INFO +1 -1
- {ultralytics-8.2.59 → ultralytics-8.2.61}/LICENSE +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/README.md +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/pyproject.toml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/setup.cfg +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/conftest.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_cli.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_cuda.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_engine.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_explorer.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_exports.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_integrations.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_python.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/tests/test_solutions.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/assets/bus.jpg +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/assets/zidane.jpg +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/VOC.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco128.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/coco8.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/dota8.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/lvis.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/signature.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/datasets/xView.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/default.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/trackers/botsort.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/annotator.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/augment.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/base.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/build.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/converter.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/explorer/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/explorer/gui/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/explorer/gui/dash.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/explorer/utils.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/loaders.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/split_dota.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/data/utils.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/predictor.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/results.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/trainer.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/tuner.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/engine/validator.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/hub/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/hub/auth.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/hub/session.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/hub/utils.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/fastsam/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/fastsam/model.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/fastsam/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/fastsam/utils.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/fastsam/val.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/nas/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/nas/model.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/nas/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/nas/val.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/rtdetr/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/rtdetr/model.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/rtdetr/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/rtdetr/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/rtdetr/val.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/amg.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/build.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/model.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/modules/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/modules/decoders.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/modules/encoders.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/modules/sam.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/modules/transformer.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/sam/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/utils/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/utils/loss.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/utils/ops.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/classify/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/classify/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/classify/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/classify/val.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/detect/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/detect/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/detect/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/model.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/obb/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/obb/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/obb/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/obb/val.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/pose/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/pose/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/pose/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/pose/val.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/segment/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/segment/predict.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/segment/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/world/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/world/train.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/models/yolo/world/train_world.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/autobackend.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/modules/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/modules/conv.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/modules/transformer.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/modules/utils.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/nn/tasks.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/ai_gym.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/analytics.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/distance_calculation.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/heatmap.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/object_counter.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/queue_management.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/speed_estimation.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/solutions/streamlit_inference.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/basetrack.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/bot_sort.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/byte_tracker.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/track.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/utils/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/utils/gmc.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/utils/kalman_filter.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/trackers/utils/matching.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/autobatch.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/__init__.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/base.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/clearml.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/comet.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/dvc.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/hub.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/mlflow.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/neptune.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/raytune.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/tensorboard.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/callbacks/wb.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/checks.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/dist.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/downloads.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/errors.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/files.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/instance.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/patches.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/plotting.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/triton.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics/utils/tuner.py +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics.egg-info/SOURCES.txt +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics.egg-info/dependency_links.txt +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics.egg-info/entry_points.txt +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics.egg-info/requires.txt +0 -0
- {ultralytics-8.2.59 → ultralytics-8.2.61}/ultralytics.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.61
|
|
4
4
|
Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
|
5
5
|
Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
6
6
|
Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
@@ -190,27 +190,23 @@ def cfg2dict(cfg):
|
|
|
190
190
|
Convert a configuration object to a dictionary, whether it is a file path, a string, or a SimpleNamespace object.
|
|
191
191
|
|
|
192
192
|
Args:
|
|
193
|
-
cfg (str | Path |
|
|
193
|
+
cfg (str | Path | Dict | SimpleNamespace): Configuration object to be converted to a dictionary. This may be a
|
|
194
194
|
path to a configuration file, a dictionary, or a SimpleNamespace object.
|
|
195
195
|
|
|
196
196
|
Returns:
|
|
197
|
-
(
|
|
197
|
+
(Dict): Configuration object in dictionary format.
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
from types import SimpleNamespace
|
|
199
|
+
Examples:
|
|
200
|
+
Convert a YAML file path to a dictionary:
|
|
201
|
+
>>> config_dict = cfg2dict('config.yaml')
|
|
203
202
|
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
Convert a SimpleNamespace to a dictionary:
|
|
204
|
+
>>> from types import SimpleNamespace
|
|
205
|
+
>>> config_sn = SimpleNamespace(param1='value1', param2='value2')
|
|
206
|
+
>>> config_dict = cfg2dict(config_sn)
|
|
206
207
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
config_dict = cfg2dict(config_sn)
|
|
210
|
-
|
|
211
|
-
# Example usage with a dictionary (returns the same dictionary)
|
|
212
|
-
config_dict = cfg2dict({'param1': 'value1', 'param2': 'value2'})
|
|
213
|
-
```
|
|
208
|
+
Pass through an already existing dictionary:
|
|
209
|
+
>>> config_dict = cfg2dict({'param1': 'value1', 'param2': 'value2'})
|
|
214
210
|
|
|
215
211
|
Notes:
|
|
216
212
|
- If `cfg` is a path or a string, it will be loaded as YAML and converted to a dictionary.
|
|
@@ -228,9 +224,8 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
|
|
|
228
224
|
Load and merge configuration data from a file or dictionary, with optional overrides.
|
|
229
225
|
|
|
230
226
|
Args:
|
|
231
|
-
cfg (str | Path |
|
|
232
|
-
overrides (
|
|
233
|
-
Defaults to None.
|
|
227
|
+
cfg (str | Path | Dict | SimpleNamespace): Configuration data source.
|
|
228
|
+
overrides (Dict | None): Dictionary containing key-value pairs to override the base configuration.
|
|
234
229
|
|
|
235
230
|
Returns:
|
|
236
231
|
(SimpleNamespace): Namespace containing the merged training arguments.
|
|
@@ -238,23 +233,15 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
|
|
|
238
233
|
Notes:
|
|
239
234
|
- If both `cfg` and `overrides` are provided, the values in `overrides` will take precedence.
|
|
240
235
|
- Special handling ensures alignment and correctness of the configuration, such as converting numeric `project`
|
|
241
|
-
and `name` to strings and validating
|
|
242
|
-
|
|
243
|
-
Example:
|
|
244
|
-
```python
|
|
245
|
-
from ultralytics.cfg import get_cfg
|
|
236
|
+
and `name` to strings and validating configuration keys and values.
|
|
246
237
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
config = get_cfg('path/to/config.yaml', overrides={'epochs': 50, 'batch_size': 16})
|
|
252
|
-
```
|
|
238
|
+
Examples:
|
|
239
|
+
Load default configuration:
|
|
240
|
+
>>> from ultralytics import get_cfg
|
|
241
|
+
>>> config = get_cfg()
|
|
253
242
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
{'epochs': 50, 'batch_size': 16, ...}
|
|
257
|
-
```
|
|
243
|
+
Load from a custom file with overrides:
|
|
244
|
+
>>> config = get_cfg('path/to/config.yaml', overrides={'epochs': 50, 'batch_size': 16})
|
|
258
245
|
"""
|
|
259
246
|
cfg = cfg2dict(cfg)
|
|
260
247
|
|
|
@@ -282,7 +269,26 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
|
|
|
282
269
|
|
|
283
270
|
|
|
284
271
|
def check_cfg(cfg, hard=True):
|
|
285
|
-
"""
|
|
272
|
+
"""
|
|
273
|
+
Checks configuration argument types and values for the Ultralytics library, ensuring correctness and converting them
|
|
274
|
+
if necessary.
|
|
275
|
+
|
|
276
|
+
Args:
|
|
277
|
+
cfg (Dict): Configuration dictionary to validate.
|
|
278
|
+
hard (bool): If True, raises exceptions for invalid types and values; if False, attempts to convert them.
|
|
279
|
+
|
|
280
|
+
Examples:
|
|
281
|
+
Validate a configuration with a mix of valid and invalid values:
|
|
282
|
+
>>> config = {
|
|
283
|
+
... 'epochs': 50, # valid integer
|
|
284
|
+
... 'lr0': 0.01, # valid float
|
|
285
|
+
... 'momentum': 1.2, # invalid float (out of 0.0-1.0 range)
|
|
286
|
+
... 'save': 'true', # invalid bool
|
|
287
|
+
... }
|
|
288
|
+
>>> check_cfg(config, hard=False)
|
|
289
|
+
>>> print(config)
|
|
290
|
+
{'epochs': 50, 'lr0': 0.01, 'momentum': 1.2, 'save': False} # corrected 'save' key and retained other values
|
|
291
|
+
"""
|
|
286
292
|
for k, v in cfg.items():
|
|
287
293
|
if v is not None: # None values may be from optional args
|
|
288
294
|
if k in CFG_FLOAT_KEYS and not isinstance(v, (int, float)):
|
|
@@ -318,7 +324,26 @@ def check_cfg(cfg, hard=True):
|
|
|
318
324
|
|
|
319
325
|
|
|
320
326
|
def get_save_dir(args, name=None):
|
|
321
|
-
"""
|
|
327
|
+
"""
|
|
328
|
+
Returns the directory path for saving outputs, derived from arguments or default settings.
|
|
329
|
+
|
|
330
|
+
Args:
|
|
331
|
+
args (SimpleNamespace): Namespace object containing configurations such as 'project', 'name', 'task', 'mode', and
|
|
332
|
+
'save_dir'.
|
|
333
|
+
name (str | None): Optional name for the output directory. If not provided, it defaults to 'args.name' or the
|
|
334
|
+
'args.mode'.
|
|
335
|
+
|
|
336
|
+
Returns:
|
|
337
|
+
(Path): Directory path where outputs should be saved.
|
|
338
|
+
|
|
339
|
+
Examples:
|
|
340
|
+
Generate a save directory using provided arguments
|
|
341
|
+
>>> from types import SimpleNamespace
|
|
342
|
+
>>> args = SimpleNamespace(project='my_project', task='detect', mode='train', exist_ok=True)
|
|
343
|
+
>>> save_dir = get_save_dir(args)
|
|
344
|
+
>>> print(save_dir)
|
|
345
|
+
my_project/detect/train
|
|
346
|
+
"""
|
|
322
347
|
|
|
323
348
|
if getattr(args, "save_dir", None):
|
|
324
349
|
save_dir = args.save_dir
|
|
@@ -333,7 +358,18 @@ def get_save_dir(args, name=None):
|
|
|
333
358
|
|
|
334
359
|
|
|
335
360
|
def _handle_deprecation(custom):
|
|
336
|
-
"""
|
|
361
|
+
"""
|
|
362
|
+
Handles deprecated configuration keys by mapping them to current equivalents with deprecation warnings.
|
|
363
|
+
|
|
364
|
+
Args:
|
|
365
|
+
custom (Dict): Configuration dictionary potentially containing deprecated keys.
|
|
366
|
+
|
|
367
|
+
Examples:
|
|
368
|
+
>>> custom_config = {"boxes": True, "hide_labels": "False", "line_thickness": 2}
|
|
369
|
+
>>> _handle_deprecation(custom_config)
|
|
370
|
+
>>> print(custom_config)
|
|
371
|
+
{'show_boxes': True, 'show_labels': True, 'line_width': 2}
|
|
372
|
+
"""
|
|
337
373
|
|
|
338
374
|
for key in custom.copy().keys():
|
|
339
375
|
if key == "boxes":
|
|
@@ -354,35 +390,32 @@ def _handle_deprecation(custom):
|
|
|
354
390
|
|
|
355
391
|
def check_dict_alignment(base: Dict, custom: Dict, e=None):
|
|
356
392
|
"""
|
|
357
|
-
Check for key alignment between custom and base configuration dictionaries,
|
|
358
|
-
|
|
393
|
+
Check for key alignment between custom and base configuration dictionaries, handling deprecated keys and providing
|
|
394
|
+
informative error messages for mismatched keys.
|
|
359
395
|
|
|
360
396
|
Args:
|
|
361
|
-
base (
|
|
362
|
-
custom (
|
|
363
|
-
e (Exception
|
|
397
|
+
base (Dict): The base configuration dictionary containing valid keys.
|
|
398
|
+
custom (Dict): The custom configuration dictionary to be checked for alignment.
|
|
399
|
+
e (Exception | None): Optional error instance passed by the calling function. Default is None.
|
|
364
400
|
|
|
365
401
|
Raises:
|
|
366
402
|
SystemExit: Terminates the program execution if mismatched keys are found.
|
|
367
403
|
|
|
368
404
|
Notes:
|
|
369
|
-
- The function
|
|
370
|
-
|
|
371
|
-
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
except SystemExit:
|
|
384
|
-
# Handle the error or correct the configuration
|
|
385
|
-
```
|
|
405
|
+
- The function suggests corrections for mismatched keys based on similarity to valid keys.
|
|
406
|
+
- Deprecated keys in the custom configuration are automatically replaced with their updated equivalents.
|
|
407
|
+
- Detailed error messages are printed for each mismatched key to help users identify and correct their custom
|
|
408
|
+
configurations.
|
|
409
|
+
|
|
410
|
+
Examples:
|
|
411
|
+
>>> base_cfg = {'epochs': 50, 'lr0': 0.01, 'batch_size': 16}
|
|
412
|
+
>>> custom_cfg = {'epoch': 100, 'lr': 0.02, 'batch_size': 32}
|
|
413
|
+
|
|
414
|
+
>>> try:
|
|
415
|
+
... check_dict_alignment(base_cfg, custom_cfg)
|
|
416
|
+
... except SystemExit:
|
|
417
|
+
... # Handle the error or correct the configuration
|
|
418
|
+
... pass
|
|
386
419
|
"""
|
|
387
420
|
custom = _handle_deprecation(custom)
|
|
388
421
|
base_keys, custom_keys = (set(x.keys()) for x in (base, custom))
|
|
@@ -401,30 +434,29 @@ def check_dict_alignment(base: Dict, custom: Dict, e=None):
|
|
|
401
434
|
|
|
402
435
|
def merge_equals_args(args: List[str]) -> List[str]:
|
|
403
436
|
"""
|
|
404
|
-
Merges arguments around isolated '='
|
|
405
|
-
argument ends with '=' or the second starts with '=', as well as when the middle one is an equals sign.
|
|
437
|
+
Merges arguments around isolated '=' in a list of strings.
|
|
406
438
|
|
|
407
439
|
Args:
|
|
408
|
-
args (List[str]): A list of strings where each element
|
|
440
|
+
args (List[str]): A list of strings where each element represents an argument.
|
|
409
441
|
|
|
410
442
|
Returns:
|
|
411
443
|
(List[str]): A list of strings where the arguments around isolated '=' are merged.
|
|
412
444
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
args
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
args = ["arg1=", "value"]
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
445
|
+
Examples:
|
|
446
|
+
Merge arguments where equals sign is separated:
|
|
447
|
+
>>> args = ["arg1", "=", "value"]
|
|
448
|
+
>>> merge_equals_args(args)
|
|
449
|
+
["arg1=value"]
|
|
450
|
+
|
|
451
|
+
Merge arguments where equals sign is at the end of the first argument:
|
|
452
|
+
>>> args = ["arg1=", "value"]
|
|
453
|
+
>>> merge_equals_args(args)
|
|
454
|
+
["arg1=value"]
|
|
455
|
+
|
|
456
|
+
Merge arguments where equals sign is at the beginning of the second argument:
|
|
457
|
+
>>> args = ["arg1", "=value"]
|
|
458
|
+
>>> merge_equals_args(args)
|
|
459
|
+
["arg1=value"]
|
|
428
460
|
"""
|
|
429
461
|
new_args = []
|
|
430
462
|
for i, arg in enumerate(args):
|
|
@@ -445,16 +477,13 @@ def handle_yolo_hub(args: List[str]) -> None:
|
|
|
445
477
|
"""
|
|
446
478
|
Handle Ultralytics HUB command-line interface (CLI) commands.
|
|
447
479
|
|
|
448
|
-
This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing
|
|
449
|
-
|
|
480
|
+
This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing a
|
|
481
|
+
script with arguments related to HUB authentication.
|
|
450
482
|
|
|
451
483
|
Args:
|
|
452
484
|
args (List[str]): A list of command line arguments.
|
|
453
485
|
|
|
454
|
-
|
|
455
|
-
None
|
|
456
|
-
|
|
457
|
-
Example:
|
|
486
|
+
Examples:
|
|
458
487
|
```bash
|
|
459
488
|
yolo hub login YOUR_API_KEY
|
|
460
489
|
```
|
|
@@ -480,13 +509,9 @@ def handle_yolo_settings(args: List[str]) -> None:
|
|
|
480
509
|
Args:
|
|
481
510
|
args (List[str]): A list of command line arguments for YOLO settings management.
|
|
482
511
|
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
Example:
|
|
487
|
-
```bash
|
|
488
|
-
yolo settings reset
|
|
489
|
-
```
|
|
512
|
+
Examples:
|
|
513
|
+
Reset YOLO settings:
|
|
514
|
+
>>> yolo settings reset
|
|
490
515
|
|
|
491
516
|
Notes:
|
|
492
517
|
For more information on handling YOLO settings, visit:
|
|
@@ -511,21 +536,58 @@ def handle_yolo_settings(args: List[str]) -> None:
|
|
|
511
536
|
|
|
512
537
|
|
|
513
538
|
def handle_explorer():
|
|
514
|
-
"""
|
|
539
|
+
"""
|
|
540
|
+
Open the Ultralytics Explorer GUI for dataset exploration and analysis.
|
|
541
|
+
|
|
542
|
+
This function launches a graphical user interface that provides tools for interacting with and analyzing datasets
|
|
543
|
+
using the Ultralytics Explorer API.
|
|
544
|
+
|
|
545
|
+
Examples:
|
|
546
|
+
Start the Ultralytics Explorer:
|
|
547
|
+
>>> handle_explorer()
|
|
548
|
+
"""
|
|
515
549
|
checks.check_requirements("streamlit>=1.29.0")
|
|
516
550
|
LOGGER.info("💡 Loading Explorer dashboard...")
|
|
517
551
|
subprocess.run(["streamlit", "run", ROOT / "data/explorer/gui/dash.py", "--server.maxMessageSize", "2048"])
|
|
518
552
|
|
|
519
553
|
|
|
520
554
|
def handle_streamlit_inference():
|
|
521
|
-
"""
|
|
555
|
+
"""
|
|
556
|
+
Open the Ultralytics Live Inference streamlit app for real-time object detection.
|
|
557
|
+
|
|
558
|
+
This function initializes and runs a Streamlit application designed for performing live object detection using
|
|
559
|
+
Ultralytics models.
|
|
560
|
+
|
|
561
|
+
References:
|
|
562
|
+
- Streamlit documentation: https://docs.streamlit.io/
|
|
563
|
+
- Ultralytics: https://docs.ultralytics.com
|
|
564
|
+
|
|
565
|
+
Examples:
|
|
566
|
+
To run the live inference Streamlit app, execute:
|
|
567
|
+
>>> handle_streamlit_inference()
|
|
568
|
+
"""
|
|
522
569
|
checks.check_requirements("streamlit>=1.29.0")
|
|
523
570
|
LOGGER.info("💡 Loading Ultralytics Live Inference app...")
|
|
524
571
|
subprocess.run(["streamlit", "run", ROOT / "solutions/streamlit_inference.py", "--server.headless", "true"])
|
|
525
572
|
|
|
526
573
|
|
|
527
574
|
def parse_key_value_pair(pair):
|
|
528
|
-
"""
|
|
575
|
+
"""
|
|
576
|
+
Parse a 'key=value' pair and return the key and value.
|
|
577
|
+
|
|
578
|
+
Args:
|
|
579
|
+
pair (str): The 'key=value' string to be parsed.
|
|
580
|
+
|
|
581
|
+
Returns:
|
|
582
|
+
(tuple[str, str]): A tuple containing the key and value as separate strings.
|
|
583
|
+
|
|
584
|
+
Examples:
|
|
585
|
+
>>> key, value = parse_key_value_pair("model=yolov8n.pt")
|
|
586
|
+
>>> key
|
|
587
|
+
'model'
|
|
588
|
+
>>> value
|
|
589
|
+
'yolov8n.pt
|
|
590
|
+
"""
|
|
529
591
|
k, v = pair.split("=", 1) # split on first '=' sign
|
|
530
592
|
k, v = k.strip(), v.strip() # remove spaces
|
|
531
593
|
assert v, f"missing '{k}' value"
|
|
@@ -533,7 +595,29 @@ def parse_key_value_pair(pair):
|
|
|
533
595
|
|
|
534
596
|
|
|
535
597
|
def smart_value(v):
|
|
536
|
-
"""
|
|
598
|
+
"""
|
|
599
|
+
Convert a string representation of a value into its appropriate Python type (int, float, bool, None, etc.).
|
|
600
|
+
|
|
601
|
+
Args:
|
|
602
|
+
v (str): String representation of the value to be converted.
|
|
603
|
+
|
|
604
|
+
Returns:
|
|
605
|
+
(Any): The converted value, which can be of type int, float, bool, None, or the original string if no conversion
|
|
606
|
+
is applicable.
|
|
607
|
+
|
|
608
|
+
Examples:
|
|
609
|
+
Convert a string to various types:
|
|
610
|
+
>>> smart_value("42")
|
|
611
|
+
42
|
|
612
|
+
>>> smart_value("3.14")
|
|
613
|
+
3.14
|
|
614
|
+
>>> smart_value("True")
|
|
615
|
+
True
|
|
616
|
+
>>> smart_value("None")
|
|
617
|
+
None
|
|
618
|
+
>>> smart_value("some_string")
|
|
619
|
+
'some_string'
|
|
620
|
+
"""
|
|
537
621
|
v_lower = v.lower()
|
|
538
622
|
if v_lower == "none":
|
|
539
623
|
return None
|
|
@@ -551,31 +635,26 @@ def entrypoint(debug=""):
|
|
|
551
635
|
"""
|
|
552
636
|
Ultralytics entrypoint function for parsing and executing command-line arguments.
|
|
553
637
|
|
|
554
|
-
This function serves as the main entry point for the Ultralytics CLI, parsing
|
|
638
|
+
This function serves as the main entry point for the Ultralytics CLI, parsing command-line arguments and
|
|
555
639
|
executing the corresponding tasks such as training, validation, prediction, exporting models, and more.
|
|
556
640
|
|
|
557
641
|
Args:
|
|
558
|
-
debug (str, optional): Space-separated string of command-line arguments for debugging purposes.
|
|
642
|
+
debug (str, optional): Space-separated string of command-line arguments for debugging purposes.
|
|
559
643
|
|
|
560
|
-
|
|
561
|
-
|
|
644
|
+
Examples:
|
|
645
|
+
Train a detection model for 10 epochs with an initial learning_rate of 0.01:
|
|
646
|
+
>>> entrypoint("train data=coco8.yaml model=yolov8n.pt epochs=10 lr0=0.01")
|
|
647
|
+
|
|
648
|
+
Predict a YouTube video using a pretrained segmentation model at image size 320:
|
|
649
|
+
>>> entrypoint("predict model=yolov8n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320")
|
|
650
|
+
|
|
651
|
+
Validate a pretrained detection model at batch-size 1 and image size 640:
|
|
652
|
+
>>> entrypoint("val model=yolov8n.pt data=coco8.yaml batch=1 imgsz=640")
|
|
562
653
|
|
|
563
654
|
Notes:
|
|
564
655
|
- For a list of all available commands and their arguments, see the provided help messages and the Ultralytics
|
|
565
656
|
documentation at https://docs.ultralytics.com.
|
|
566
657
|
- If no arguments are passed, the function will display the usage help message.
|
|
567
|
-
|
|
568
|
-
Example:
|
|
569
|
-
```python
|
|
570
|
-
# Train a detection model for 10 epochs with an initial learning_rate of 0.01
|
|
571
|
-
entrypoint("train data=coco8.yaml model=yolov8n.pt epochs=10 lr0=0.01")
|
|
572
|
-
|
|
573
|
-
# Predict a YouTube video using a pretrained segmentation model at image size 320
|
|
574
|
-
entrypoint("predict model=yolov8n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320")
|
|
575
|
-
|
|
576
|
-
# Validate a pretrained detection model at batch-size 1 and image size 640
|
|
577
|
-
entrypoint("val model=yolov8n.pt data=coco8.yaml batch=1 imgsz=640")
|
|
578
|
-
```
|
|
579
658
|
"""
|
|
580
659
|
args = (debug.split(" ") if debug else ARGV)[1:]
|
|
581
660
|
if not args: # no arguments passed
|
|
@@ -713,7 +792,18 @@ def entrypoint(debug=""):
|
|
|
713
792
|
|
|
714
793
|
# Special modes --------------------------------------------------------------------------------------------------------
|
|
715
794
|
def copy_default_cfg():
|
|
716
|
-
"""
|
|
795
|
+
"""
|
|
796
|
+
Copy and create a new default configuration file with '_copy' appended to its name, providing a usage example.
|
|
797
|
+
|
|
798
|
+
This function duplicates the existing default configuration file and appends '_copy' to its name in the current
|
|
799
|
+
working directory.
|
|
800
|
+
|
|
801
|
+
Examples:
|
|
802
|
+
Copy the default configuration file and use it in a YOLO command:
|
|
803
|
+
>>> copy_default_cfg()
|
|
804
|
+
>>> # Example YOLO command with this new custom cfg:
|
|
805
|
+
>>> # yolo cfg='default_copy.yaml' imgsz=320 batch=8
|
|
806
|
+
"""
|
|
717
807
|
new_file = Path.cwd() / DEFAULT_CFG_PATH.name.replace(".yaml", "_copy.yaml")
|
|
718
808
|
shutil.copy2(DEFAULT_CFG_PATH, new_file)
|
|
719
809
|
LOGGER.info(
|
|
@@ -280,6 +280,8 @@ class YOLOMultiModalDataset(YOLODataset):
|
|
|
280
280
|
|
|
281
281
|
|
|
282
282
|
class GroundingDataset(YOLODataset):
|
|
283
|
+
"""Handles object detection tasks by loading annotations from a specified JSON file, supporting YOLO format."""
|
|
284
|
+
|
|
283
285
|
def __init__(self, *args, task="detect", json_file, **kwargs):
|
|
284
286
|
"""Initializes a GroundingDataset for object detection, loading annotations from a specified JSON file."""
|
|
285
287
|
assert task == "detect", "`GroundingDataset` only support `detect` task for now!"
|
|
@@ -21,6 +21,8 @@ from .utils import get_sim_index_schema, get_table_schema, plot_query_result, pr
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class ExplorerDataset(YOLODataset):
|
|
24
|
+
"""Extends YOLODataset for advanced data exploration and manipulation in model training workflows."""
|
|
25
|
+
|
|
24
26
|
def __init__(self, *args, data: dict = None, **kwargs) -> None:
|
|
25
27
|
"""Initializes the ExplorerDataset with the provided data arguments, extending the YOLODataset class."""
|
|
26
28
|
super().__init__(*args, data=data, **kwargs)
|
|
@@ -54,6 +56,8 @@ class ExplorerDataset(YOLODataset):
|
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
class Explorer:
|
|
59
|
+
"""Utility class for image embedding, table creation, and similarity querying using LanceDB and YOLO models."""
|
|
60
|
+
|
|
57
61
|
def __init__(
|
|
58
62
|
self,
|
|
59
63
|
data: Union[str, Path] = "coco128.yaml",
|
|
@@ -563,7 +563,7 @@ class Exporter:
|
|
|
563
563
|
LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, using default {asset}")
|
|
564
564
|
unzip_dir = safe_download(f"https://github.com/pnnx/pnnx/releases/download/{release}/{asset}", delete=True)
|
|
565
565
|
if check_is_path_safe(Path.cwd(), unzip_dir): # avoid path traversal security vulnerability
|
|
566
|
-
(unzip_dir / name
|
|
566
|
+
shutil.move(src=unzip_dir / name, dst=pnnx) # move binary to ROOT
|
|
567
567
|
pnnx.chmod(0o777) # set read, write, and execute permissions for everyone
|
|
568
568
|
shutil.rmtree(unzip_dir) # delete unzip dir
|
|
569
569
|
|
|
@@ -588,7 +588,13 @@ class Model(nn.Module):
|
|
|
588
588
|
self._check_is_pytorch_model()
|
|
589
589
|
from .exporter import Exporter
|
|
590
590
|
|
|
591
|
-
custom = {
|
|
591
|
+
custom = {
|
|
592
|
+
"imgsz": self.model.args["imgsz"],
|
|
593
|
+
"batch": 1,
|
|
594
|
+
"data": None,
|
|
595
|
+
"device": None, # reset to avoid multi-GPU errors
|
|
596
|
+
"verbose": False,
|
|
597
|
+
} # method defaults
|
|
592
598
|
args = {**self.overrides, **custom, **kwargs, "mode": "export"} # highest priority args on the right
|
|
593
599
|
return Exporter(overrides=args, _callbacks=self.callbacks)(model=self.model)
|
|
594
600
|
|
|
@@ -335,12 +335,12 @@ class FastSAMPrompt:
|
|
|
335
335
|
self.results[0].masks.data = torch.tensor(np.array([onemask]))
|
|
336
336
|
return self.results
|
|
337
337
|
|
|
338
|
-
def text_prompt(self, text):
|
|
338
|
+
def text_prompt(self, text, clip_download_root=None):
|
|
339
339
|
"""Processes a text prompt, applies it to existing results and returns the updated results."""
|
|
340
340
|
if self.results[0].masks is not None:
|
|
341
341
|
format_results = self._format_results(self.results[0], 0)
|
|
342
342
|
cropped_images, filter_id, annotations = self._crop_image(format_results)
|
|
343
|
-
clip_model, preprocess = self.clip.load("ViT-B/32", device=self.device)
|
|
343
|
+
clip_model, preprocess = self.clip.load("ViT-B/32", download_root=clip_download_root, device=self.device)
|
|
344
344
|
scores = self.retrieve(clip_model, preprocess, cropped_images, text, device=self.device)
|
|
345
345
|
max_idx = torch.argmax(scores)
|
|
346
346
|
max_idx += sum(np.array(filter_id) <= int(max_idx))
|
|
@@ -68,7 +68,11 @@ class DetectionValidator(BaseValidator):
|
|
|
68
68
|
def init_metrics(self, model):
|
|
69
69
|
"""Initialize evaluation metrics for YOLO."""
|
|
70
70
|
val = self.data.get(self.args.split, "") # validation path
|
|
71
|
-
self.is_coco =
|
|
71
|
+
self.is_coco = (
|
|
72
|
+
isinstance(val, str)
|
|
73
|
+
and "coco" in val
|
|
74
|
+
and (val.endswith(f"{os.sep}val2017.txt") or val.endswith(f"{os.sep}test-dev2017.txt"))
|
|
75
|
+
) # is COCO
|
|
72
76
|
self.is_lvis = isinstance(val, str) and "lvis" in val and not self.is_coco # is LVIS
|
|
73
77
|
self.class_map = converter.coco80_to_coco91_class() if self.is_coco else list(range(len(model.names)))
|
|
74
78
|
self.args.save_json |= (self.is_coco or self.is_lvis) and not self.training # run on final val if training COCO
|
|
@@ -49,7 +49,7 @@ class SegmentationValidator(DetectionValidator):
|
|
|
49
49
|
if self.args.save_json:
|
|
50
50
|
check_requirements("pycocotools>=2.0.6")
|
|
51
51
|
# more accurate vs faster
|
|
52
|
-
self.process = ops.
|
|
52
|
+
self.process = ops.process_mask_native if self.args.save_json or self.args.save_txt else ops.process_mask
|
|
53
53
|
self.stats = dict(tp_m=[], tp=[], conf=[], pred_cls=[], target_cls=[], target_img=[])
|
|
54
54
|
|
|
55
55
|
def get_desc(self):
|
|
@@ -930,6 +930,8 @@ class PSA(nn.Module):
|
|
|
930
930
|
|
|
931
931
|
|
|
932
932
|
class SCDown(nn.Module):
|
|
933
|
+
"""Spatial Channel Downsample (SCDown) module for reducing spatial and channel dimensions."""
|
|
934
|
+
|
|
933
935
|
def __init__(self, c1, c2, k, s):
|
|
934
936
|
"""
|
|
935
937
|
Spatial Channel Downsample (SCDown) module.
|
|
@@ -281,6 +281,8 @@ class Classify(nn.Module):
|
|
|
281
281
|
|
|
282
282
|
|
|
283
283
|
class WorldDetect(Detect):
|
|
284
|
+
"""Head for integrating YOLOv8 detection models with semantic understanding from text embeddings."""
|
|
285
|
+
|
|
284
286
|
def __init__(self, nc=80, embed=512, with_bn=False, ch=()):
|
|
285
287
|
"""Initialize YOLOv8 detection layer with nc classes and layer channels ch."""
|
|
286
288
|
super().__init__(nc, ch)
|
|
@@ -10,6 +10,8 @@ from ultralytics.utils.plotting import Annotator
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class ParkingPtsSelection:
|
|
13
|
+
"""Class for selecting and managing parking zone points on images using a Tkinter-based UI."""
|
|
14
|
+
|
|
13
15
|
def __init__(self):
|
|
14
16
|
"""Initializes the UI for selecting parking zone points in a tkinter window."""
|
|
15
17
|
check_requirements("tkinter")
|
|
@@ -154,6 +156,8 @@ class ParkingPtsSelection:
|
|
|
154
156
|
|
|
155
157
|
|
|
156
158
|
class ParkingManagement:
|
|
159
|
+
"""Manages parking occupancy and availability using YOLOv8 for real-time monitoring and visualization."""
|
|
160
|
+
|
|
157
161
|
def __init__(
|
|
158
162
|
self,
|
|
159
163
|
model_path,
|
|
@@ -607,12 +607,10 @@ class v8ClassificationLoss:
|
|
|
607
607
|
|
|
608
608
|
|
|
609
609
|
class v8OBBLoss(v8DetectionLoss):
|
|
610
|
-
|
|
611
|
-
"""
|
|
612
|
-
Initializes v8OBBLoss with model, assigner, and rotated bbox loss.
|
|
610
|
+
"""Calculates losses for object detection, classification, and box distribution in rotated YOLO models."""
|
|
613
611
|
|
|
614
|
-
|
|
615
|
-
"""
|
|
612
|
+
def __init__(self, model):
|
|
613
|
+
"""Initializes v8OBBLoss with model, assigner, and rotated bbox loss; note model must be de-paralleled."""
|
|
616
614
|
super().__init__(model)
|
|
617
615
|
self.assigner = RotatedTaskAlignedAssigner(topk=10, num_classes=self.nc, alpha=0.5, beta=6.0)
|
|
618
616
|
self.bbox_loss = RotatedBboxLoss(self.reg_max).to(self.device)
|
|
@@ -1221,6 +1221,8 @@ class ClassifyMetrics(SimpleClass):
|
|
|
1221
1221
|
|
|
1222
1222
|
|
|
1223
1223
|
class OBBMetrics(SimpleClass):
|
|
1224
|
+
"""Metrics for evaluating oriented bounding box (OBB) detection, see https://arxiv.org/pdf/2106.06072.pdf."""
|
|
1225
|
+
|
|
1224
1226
|
def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names=()) -> None:
|
|
1225
1227
|
"""Initialize an OBBMetrics instance with directory, plotting, callback, and class names."""
|
|
1226
1228
|
self.save_dir = save_dir
|