mblt-vision-python 0.0.0__py3-none-any.whl
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.
- mblt_vision/__init__.py +86 -0
- mblt_vision/_api.py +53 -0
- mblt_vision/_compat.py +227 -0
- mblt_vision/_model_paths.py +137 -0
- mblt_vision/_tasks.py +30 -0
- mblt_vision/benchmark/__init__.py +1 -0
- mblt_vision/benchmark/argparse_utils.py +106 -0
- mblt_vision/benchmark/chart_utils.py +146 -0
- mblt_vision/benchmark/io_utils.py +64 -0
- mblt_vision/benchmark/summary_utils.py +770 -0
- mblt_vision/cli/__init__.py +5 -0
- mblt_vision/cli/__main__.py +5 -0
- mblt_vision/cli/_vision.py +337 -0
- mblt_vision/cli/compile.py +117 -0
- mblt_vision/cli/main.py +35 -0
- mblt_vision/cli/predict.py +64 -0
- mblt_vision/cli/val.py +562 -0
- mblt_vision/compile/__init__.py +21 -0
- mblt_vision/compile/vision.py +1120 -0
- mblt_vision/datasets/__init__.py +15 -0
- mblt_vision/datasets/ade20k.yaml +164 -0
- mblt_vision/datasets/cityscapes.yaml +54 -0
- mblt_vision/datasets/coco.yaml +178 -0
- mblt_vision/datasets/dotav1.yaml +28 -0
- mblt_vision/datasets/imagenet.yaml +1019 -0
- mblt_vision/datasets/imagenet_synsets.txt +1000 -0
- mblt_vision/datasets/nyu-depth.yaml +7 -0
- mblt_vision/datasets/registry.py +158 -0
- mblt_vision/datasets/widerface.yaml +9 -0
- mblt_vision/depth_estimation/__init__.py +19 -0
- mblt_vision/face_detection/__init__.py +43 -0
- mblt_vision/image_classification/__init__.py +311 -0
- mblt_vision/instance_segmentation/__init__.py +65 -0
- mblt_vision/models/AlexNet.yaml +23 -0
- mblt_vision/models/CAFormer_B36.yaml +22 -0
- mblt_vision/models/CAFormer_M36.yaml +22 -0
- mblt_vision/models/CAFormer_S18.yaml +22 -0
- mblt_vision/models/CAFormer_S36.yaml +22 -0
- mblt_vision/models/CoAtNet_0_RW_224.yaml +22 -0
- mblt_vision/models/CoAtNet_1_RW_224.yaml +22 -0
- mblt_vision/models/CoAtNet_2_RW_224.yaml +22 -0
- mblt_vision/models/ConvFormer_B36.yaml +22 -0
- mblt_vision/models/ConvFormer_M36.yaml +22 -0
- mblt_vision/models/ConvFormer_S18.yaml +22 -0
- mblt_vision/models/ConvFormer_S36.yaml +22 -0
- mblt_vision/models/ConvNext_Base.yaml +23 -0
- mblt_vision/models/ConvNext_Large.yaml +23 -0
- mblt_vision/models/ConvNext_Small.yaml +23 -0
- mblt_vision/models/ConvNext_Tiny.yaml +23 -0
- mblt_vision/models/DeiT3_Base_Patch16_224.yaml +22 -0
- mblt_vision/models/DeiT3_Base_Patch16_384.yaml +22 -0
- mblt_vision/models/DeiT3_Large_Patch16_224.yaml +22 -0
- mblt_vision/models/DeiT3_Large_Patch16_384.yaml +22 -0
- mblt_vision/models/DeiT3_Medium_Patch16_224.yaml +22 -0
- mblt_vision/models/DeiT3_Small_Patch16_224.yaml +22 -0
- mblt_vision/models/DeiT3_Small_Patch16_384.yaml +22 -0
- mblt_vision/models/DeiT_Base_Patch16_224.yaml +22 -0
- mblt_vision/models/DeiT_Base_Patch16_384.yaml +22 -0
- mblt_vision/models/DeiT_Small_Patch16_224.yaml +22 -0
- mblt_vision/models/DeiT_Tiny_Patch16_224.yaml +22 -0
- mblt_vision/models/DenseNet121.yaml +23 -0
- mblt_vision/models/DenseNet161.yaml +23 -0
- mblt_vision/models/DenseNet169.yaml +23 -0
- mblt_vision/models/DenseNet201.yaml +23 -0
- mblt_vision/models/EfficientFormer_L1.yaml +22 -0
- mblt_vision/models/EfficientFormer_L3.yaml +22 -0
- mblt_vision/models/EfficientFormer_L7.yaml +22 -0
- mblt_vision/models/EfficientNet_B0.yaml +23 -0
- mblt_vision/models/EfficientNet_B1.yaml +32 -0
- mblt_vision/models/EfficientNet_B2.yaml +23 -0
- mblt_vision/models/EfficientNet_B3.yaml +23 -0
- mblt_vision/models/EfficientNet_B4.yaml +23 -0
- mblt_vision/models/EfficientNet_B5.yaml +23 -0
- mblt_vision/models/EfficientNet_B6.yaml +23 -0
- mblt_vision/models/EfficientNet_B7.yaml +23 -0
- mblt_vision/models/EfficientNet_V2_L.yaml +23 -0
- mblt_vision/models/EfficientNet_V2_M.yaml +23 -0
- mblt_vision/models/EfficientNet_V2_S.yaml +23 -0
- mblt_vision/models/FlexiVit_Base.yaml +22 -0
- mblt_vision/models/FlexiVit_Large.yaml +22 -0
- mblt_vision/models/FlexiVit_Small.yaml +22 -0
- mblt_vision/models/GELANc-seg.yaml +29 -0
- mblt_vision/models/GELANc.yaml +28 -0
- mblt_vision/models/GELANe.yaml +28 -0
- mblt_vision/models/GELANm.yaml +28 -0
- mblt_vision/models/GELANs.yaml +28 -0
- mblt_vision/models/GoogLeNet.yaml +23 -0
- mblt_vision/models/Inception_V3.yaml +23 -0
- mblt_vision/models/LeViT_Conv_128.yaml +22 -0
- mblt_vision/models/LeViT_Conv_128S.yaml +22 -0
- mblt_vision/models/LeViT_Conv_192.yaml +22 -0
- mblt_vision/models/LeViT_Conv_256.yaml +22 -0
- mblt_vision/models/LeViT_Conv_384.yaml +22 -0
- mblt_vision/models/MNASNet0_5.yaml +23 -0
- mblt_vision/models/MNASNet0_75.yaml +23 -0
- mblt_vision/models/MNASNet1_0.yaml +23 -0
- mblt_vision/models/MNASNet1_3.yaml +23 -0
- mblt_vision/models/MobileNet_V2.yaml +32 -0
- mblt_vision/models/MobileNet_V3_Large.yaml +32 -0
- mblt_vision/models/MobileNet_V3_Small.yaml +23 -0
- mblt_vision/models/RegNet_X_16GF.yaml +32 -0
- mblt_vision/models/RegNet_X_1_6GF.yaml +32 -0
- mblt_vision/models/RegNet_X_32GF.yaml +32 -0
- mblt_vision/models/RegNet_X_3_2GF.yaml +32 -0
- mblt_vision/models/RegNet_X_400MF.yaml +32 -0
- mblt_vision/models/RegNet_X_800MF.yaml +32 -0
- mblt_vision/models/RegNet_X_8GF.yaml +32 -0
- mblt_vision/models/RegNet_Y_16GF.yaml +76 -0
- mblt_vision/models/RegNet_Y_1_6GF.yaml +32 -0
- mblt_vision/models/RegNet_Y_32GF.yaml +76 -0
- mblt_vision/models/RegNet_Y_3_2GF.yaml +32 -0
- mblt_vision/models/RegNet_Y_400MF.yaml +32 -0
- mblt_vision/models/RegNet_Y_800MF.yaml +32 -0
- mblt_vision/models/RegNet_Y_8GF.yaml +32 -0
- mblt_vision/models/RepViT_M0_9.yaml +22 -0
- mblt_vision/models/RepViT_M1.yaml +22 -0
- mblt_vision/models/RepViT_M1_0.yaml +22 -0
- mblt_vision/models/RepViT_M1_1.yaml +22 -0
- mblt_vision/models/RepViT_M1_5.yaml +22 -0
- mblt_vision/models/RepViT_M2.yaml +22 -0
- mblt_vision/models/RepViT_M2_3.yaml +22 -0
- mblt_vision/models/RepViT_M3.yaml +22 -0
- mblt_vision/models/ResNeXt101_32X8D.yaml +32 -0
- mblt_vision/models/ResNeXt101_64X4D.yaml +23 -0
- mblt_vision/models/ResNeXt50_32X4D.yaml +32 -0
- mblt_vision/models/ResNet101.yaml +32 -0
- mblt_vision/models/ResNet152.yaml +32 -0
- mblt_vision/models/ResNet18.yaml +23 -0
- mblt_vision/models/ResNet34.yaml +23 -0
- mblt_vision/models/ResNet50.yaml +32 -0
- mblt_vision/models/ShuffleNet_V2_X0_5.yaml +23 -0
- mblt_vision/models/ShuffleNet_V2_X1_0.yaml +23 -0
- mblt_vision/models/ShuffleNet_V2_X1_5.yaml +23 -0
- mblt_vision/models/ShuffleNet_V2_X2_0.yaml +23 -0
- mblt_vision/models/SqueezeNet1_0.yaml +23 -0
- mblt_vision/models/SqueezeNet1_1.yaml +23 -0
- mblt_vision/models/Swin_B.yaml +23 -0
- mblt_vision/models/Swin_S.yaml +23 -0
- mblt_vision/models/Swin_T.yaml +23 -0
- mblt_vision/models/VGG11.yaml +23 -0
- mblt_vision/models/VGG11_BN.yaml +23 -0
- mblt_vision/models/VGG13.yaml +23 -0
- mblt_vision/models/VGG13_BN.yaml +23 -0
- mblt_vision/models/VGG16.yaml +23 -0
- mblt_vision/models/VGG16_BN.yaml +23 -0
- mblt_vision/models/VGG19.yaml +23 -0
- mblt_vision/models/VGG19_BN.yaml +23 -0
- mblt_vision/models/ViT_B_16.yaml +67 -0
- mblt_vision/models/ViT_B_32.yaml +23 -0
- mblt_vision/models/ViT_Base_Patch16_224.yaml +22 -0
- mblt_vision/models/ViT_Base_Patch16_384.yaml +22 -0
- mblt_vision/models/ViT_Base_Patch32_224.yaml +22 -0
- mblt_vision/models/ViT_Base_Patch32_384.yaml +22 -0
- mblt_vision/models/ViT_Base_Patch8_224.yaml +22 -0
- mblt_vision/models/ViT_L_16.yaml +67 -0
- mblt_vision/models/ViT_L_32.yaml +23 -0
- mblt_vision/models/ViT_Large_Patch16_224.yaml +22 -0
- mblt_vision/models/ViT_Large_Patch16_384.yaml +22 -0
- mblt_vision/models/ViT_Large_Patch32_384.yaml +22 -0
- mblt_vision/models/ViT_Small_Patch16_224.yaml +22 -0
- mblt_vision/models/ViT_Small_Patch16_384.yaml +22 -0
- mblt_vision/models/ViT_Small_Patch32_224.yaml +22 -0
- mblt_vision/models/ViT_Small_Patch32_384.yaml +22 -0
- mblt_vision/models/ViT_Tiny_Patch16_224.yaml +22 -0
- mblt_vision/models/ViT_Tiny_Patch16_384.yaml +22 -0
- mblt_vision/models/VisFormer_Small.yaml +22 -0
- mblt_vision/models/VisFormer_Tiny.yaml +22 -0
- mblt_vision/models/Wide_ResNet101_2.yaml +32 -0
- mblt_vision/models/Wide_ResNet50_2.yaml +32 -0
- mblt_vision/models/YOLO11l-cls.yaml +23 -0
- mblt_vision/models/YOLO11l-face.yaml +27 -0
- mblt_vision/models/YOLO11l-obb.yaml +28 -0
- mblt_vision/models/YOLO11l-pose.yaml +28 -0
- mblt_vision/models/YOLO11l-seg.yaml +28 -0
- mblt_vision/models/YOLO11l.yaml +27 -0
- mblt_vision/models/YOLO11m-cls.yaml +23 -0
- mblt_vision/models/YOLO11m-face.yaml +27 -0
- mblt_vision/models/YOLO11m-obb.yaml +28 -0
- mblt_vision/models/YOLO11m-pose.yaml +28 -0
- mblt_vision/models/YOLO11m-seg.yaml +28 -0
- mblt_vision/models/YOLO11m.yaml +27 -0
- mblt_vision/models/YOLO11n-cls.yaml +23 -0
- mblt_vision/models/YOLO11n-face.yaml +27 -0
- mblt_vision/models/YOLO11n-obb.yaml +28 -0
- mblt_vision/models/YOLO11n-pose.yaml +28 -0
- mblt_vision/models/YOLO11n-seg.yaml +28 -0
- mblt_vision/models/YOLO11n.yaml +27 -0
- mblt_vision/models/YOLO11s-cls.yaml +23 -0
- mblt_vision/models/YOLO11s-face.yaml +27 -0
- mblt_vision/models/YOLO11s-obb.yaml +28 -0
- mblt_vision/models/YOLO11s-pose.yaml +28 -0
- mblt_vision/models/YOLO11s-seg.yaml +28 -0
- mblt_vision/models/YOLO11s.yaml +27 -0
- mblt_vision/models/YOLO11x-cls.yaml +23 -0
- mblt_vision/models/YOLO11x-obb.yaml +28 -0
- mblt_vision/models/YOLO11x-pose.yaml +28 -0
- mblt_vision/models/YOLO11x-seg.yaml +28 -0
- mblt_vision/models/YOLO11x.yaml +27 -0
- mblt_vision/models/YOLO12l-face.yaml +27 -0
- mblt_vision/models/YOLO12l-seg.yaml +28 -0
- mblt_vision/models/YOLO12l.yaml +27 -0
- mblt_vision/models/YOLO12m-face.yaml +27 -0
- mblt_vision/models/YOLO12m-seg.yaml +28 -0
- mblt_vision/models/YOLO12m.yaml +27 -0
- mblt_vision/models/YOLO12n-face.yaml +27 -0
- mblt_vision/models/YOLO12n-seg.yaml +28 -0
- mblt_vision/models/YOLO12n.yaml +27 -0
- mblt_vision/models/YOLO12s-face.yaml +27 -0
- mblt_vision/models/YOLO12s-seg.yaml +28 -0
- mblt_vision/models/YOLO12s.yaml +27 -0
- mblt_vision/models/YOLO12x-seg.yaml +28 -0
- mblt_vision/models/YOLO12x.yaml +27 -0
- mblt_vision/models/YOLO26l-cls.yaml +23 -0
- mblt_vision/models/YOLO26l-depth.yaml +17 -0
- mblt_vision/models/YOLO26l-distill.yaml +27 -0
- mblt_vision/models/YOLO26l-obb.yaml +28 -0
- mblt_vision/models/YOLO26l-pose.yaml +28 -0
- mblt_vision/models/YOLO26l-seg.yaml +28 -0
- mblt_vision/models/YOLO26l-sem-ade20k.yaml +17 -0
- mblt_vision/models/YOLO26l-sem.yaml +17 -0
- mblt_vision/models/YOLO26l.yaml +27 -0
- mblt_vision/models/YOLO26m-cls.yaml +23 -0
- mblt_vision/models/YOLO26m-depth.yaml +17 -0
- mblt_vision/models/YOLO26m-distill.yaml +27 -0
- mblt_vision/models/YOLO26m-obb.yaml +28 -0
- mblt_vision/models/YOLO26m-pose.yaml +28 -0
- mblt_vision/models/YOLO26m-seg.yaml +28 -0
- mblt_vision/models/YOLO26m-sem-ade20k.yaml +17 -0
- mblt_vision/models/YOLO26m-sem.yaml +17 -0
- mblt_vision/models/YOLO26m.yaml +27 -0
- mblt_vision/models/YOLO26n-cls.yaml +23 -0
- mblt_vision/models/YOLO26n-depth.yaml +17 -0
- mblt_vision/models/YOLO26n-distill.yaml +27 -0
- mblt_vision/models/YOLO26n-obb.yaml +28 -0
- mblt_vision/models/YOLO26n-pose.yaml +28 -0
- mblt_vision/models/YOLO26n-seg.yaml +28 -0
- mblt_vision/models/YOLO26n-sem-ade20k.yaml +17 -0
- mblt_vision/models/YOLO26n-sem.yaml +17 -0
- mblt_vision/models/YOLO26n.yaml +27 -0
- mblt_vision/models/YOLO26s-cls.yaml +23 -0
- mblt_vision/models/YOLO26s-depth.yaml +17 -0
- mblt_vision/models/YOLO26s-distill.yaml +27 -0
- mblt_vision/models/YOLO26s-obb.yaml +28 -0
- mblt_vision/models/YOLO26s-pose.yaml +28 -0
- mblt_vision/models/YOLO26s-seg.yaml +28 -0
- mblt_vision/models/YOLO26s-sem-ade20k.yaml +17 -0
- mblt_vision/models/YOLO26s-sem.yaml +17 -0
- mblt_vision/models/YOLO26s.yaml +27 -0
- mblt_vision/models/YOLO26x-cls.yaml +23 -0
- mblt_vision/models/YOLO26x-depth.yaml +17 -0
- mblt_vision/models/YOLO26x-distill.yaml +27 -0
- mblt_vision/models/YOLO26x-obb.yaml +28 -0
- mblt_vision/models/YOLO26x-pose.yaml +28 -0
- mblt_vision/models/YOLO26x-seg.yaml +28 -0
- mblt_vision/models/YOLO26x-sem-ade20k.yaml +17 -0
- mblt_vision/models/YOLO26x-sem.yaml +17 -0
- mblt_vision/models/YOLO26x.yaml +27 -0
- mblt_vision/models/YOLOv10b.yaml +28 -0
- mblt_vision/models/YOLOv10l-face.yaml +28 -0
- mblt_vision/models/YOLOv10l.yaml +28 -0
- mblt_vision/models/YOLOv10m-face.yaml +28 -0
- mblt_vision/models/YOLOv10m.yaml +28 -0
- mblt_vision/models/YOLOv10n-face.yaml +28 -0
- mblt_vision/models/YOLOv10n.yaml +28 -0
- mblt_vision/models/YOLOv10s-face.yaml +28 -0
- mblt_vision/models/YOLOv10s.yaml +28 -0
- mblt_vision/models/YOLOv10x.yaml +28 -0
- mblt_vision/models/YOLOv3-spp.yaml +44 -0
- mblt_vision/models/YOLOv3-sppu.yaml +27 -0
- mblt_vision/models/YOLOv3-tiny.yaml +38 -0
- mblt_vision/models/YOLOv3-tinyu.yaml +27 -0
- mblt_vision/models/YOLOv3.yaml +44 -0
- mblt_vision/models/YOLOv3u.yaml +27 -0
- mblt_vision/models/YOLOv5l-cls.yaml +22 -0
- mblt_vision/models/YOLOv5l-seg.yaml +45 -0
- mblt_vision/models/YOLOv5l.yaml +44 -0
- mblt_vision/models/YOLOv5l6.yaml +50 -0
- mblt_vision/models/YOLOv5l6u.yaml +27 -0
- mblt_vision/models/YOLOv5lu.yaml +27 -0
- mblt_vision/models/YOLOv5m-cls.yaml +22 -0
- mblt_vision/models/YOLOv5m-seg.yaml +45 -0
- mblt_vision/models/YOLOv5m.yaml +45 -0
- mblt_vision/models/YOLOv5m6.yaml +50 -0
- mblt_vision/models/YOLOv5m6u.yaml +27 -0
- mblt_vision/models/YOLOv5mu.yaml +27 -0
- mblt_vision/models/YOLOv5n-cls.yaml +22 -0
- mblt_vision/models/YOLOv5n-seg.yaml +45 -0
- mblt_vision/models/YOLOv5n.yaml +44 -0
- mblt_vision/models/YOLOv5n6.yaml +50 -0
- mblt_vision/models/YOLOv5n6u.yaml +27 -0
- mblt_vision/models/YOLOv5nu.yaml +27 -0
- mblt_vision/models/YOLOv5s-cls.yaml +22 -0
- mblt_vision/models/YOLOv5s-seg.yaml +45 -0
- mblt_vision/models/YOLOv5s.yaml +44 -0
- mblt_vision/models/YOLOv5s6.yaml +50 -0
- mblt_vision/models/YOLOv5s6u.yaml +27 -0
- mblt_vision/models/YOLOv5su.yaml +27 -0
- mblt_vision/models/YOLOv5x-cls.yaml +22 -0
- mblt_vision/models/YOLOv5x-seg.yaml +45 -0
- mblt_vision/models/YOLOv5x.yaml +44 -0
- mblt_vision/models/YOLOv5x6.yaml +50 -0
- mblt_vision/models/YOLOv5x6u.yaml +27 -0
- mblt_vision/models/YOLOv5xu.yaml +27 -0
- mblt_vision/models/YOLOv6m-face.yaml +27 -0
- mblt_vision/models/YOLOv6n-face.yaml +27 -0
- mblt_vision/models/YOLOv7.yaml +44 -0
- mblt_vision/models/YOLOv7d6.yaml +50 -0
- mblt_vision/models/YOLOv7e6.yaml +50 -0
- mblt_vision/models/YOLOv7e6e.yaml +50 -0
- mblt_vision/models/YOLOv7w6.yaml +50 -0
- mblt_vision/models/YOLOv7x.yaml +44 -0
- mblt_vision/models/YOLOv8l-cls.yaml +23 -0
- mblt_vision/models/YOLOv8l-face.yaml +27 -0
- mblt_vision/models/YOLOv8l-obb.yaml +28 -0
- mblt_vision/models/YOLOv8l-pose.yaml +28 -0
- mblt_vision/models/YOLOv8l-seg.yaml +28 -0
- mblt_vision/models/YOLOv8l.yaml +27 -0
- mblt_vision/models/YOLOv8m-cls.yaml +23 -0
- mblt_vision/models/YOLOv8m-face.yaml +27 -0
- mblt_vision/models/YOLOv8m-obb.yaml +28 -0
- mblt_vision/models/YOLOv8m-pose.yaml +28 -0
- mblt_vision/models/YOLOv8m-seg.yaml +28 -0
- mblt_vision/models/YOLOv8m.yaml +27 -0
- mblt_vision/models/YOLOv8n-cls.yaml +23 -0
- mblt_vision/models/YOLOv8n-face.yaml +27 -0
- mblt_vision/models/YOLOv8n-obb.yaml +28 -0
- mblt_vision/models/YOLOv8n-pose.yaml +28 -0
- mblt_vision/models/YOLOv8n-seg.yaml +28 -0
- mblt_vision/models/YOLOv8n.yaml +27 -0
- mblt_vision/models/YOLOv8s-cls.yaml +23 -0
- mblt_vision/models/YOLOv8s-obb.yaml +28 -0
- mblt_vision/models/YOLOv8s-pose.yaml +28 -0
- mblt_vision/models/YOLOv8s-seg.yaml +28 -0
- mblt_vision/models/YOLOv8s.yaml +27 -0
- mblt_vision/models/YOLOv8x-cls.yaml +23 -0
- mblt_vision/models/YOLOv8x-obb.yaml +28 -0
- mblt_vision/models/YOLOv8x-pose-p6.yaml +28 -0
- mblt_vision/models/YOLOv8x-pose.yaml +28 -0
- mblt_vision/models/YOLOv8x-seg.yaml +28 -0
- mblt_vision/models/YOLOv8x.yaml +27 -0
- mblt_vision/models/YOLOv9c-seg.yaml +28 -0
- mblt_vision/models/YOLOv9c.yaml +27 -0
- mblt_vision/models/YOLOv9e-seg.yaml +28 -0
- mblt_vision/models/YOLOv9e.yaml +27 -0
- mblt_vision/models/YOLOv9m.yaml +27 -0
- mblt_vision/models/YOLOv9s.yaml +27 -0
- mblt_vision/models/YOLOv9t.yaml +27 -0
- mblt_vision/obb/__init__.py +39 -0
- mblt_vision/object_detection/__init__.py +153 -0
- mblt_vision/pose_estimation/__init__.py +41 -0
- mblt_vision/py.typed +1 -0
- mblt_vision/semantic_segmentation/__init__.py +29 -0
- mblt_vision/utils/__init__.py +0 -0
- mblt_vision/utils/datasets/__init__.py +85 -0
- mblt_vision/utils/datasets/ade20k.py +41 -0
- mblt_vision/utils/datasets/cityscapes.py +66 -0
- mblt_vision/utils/datasets/coco.py +243 -0
- mblt_vision/utils/datasets/dataloader.py +1016 -0
- mblt_vision/utils/datasets/dotav1.py +59 -0
- mblt_vision/utils/datasets/imagenet.py +29 -0
- mblt_vision/utils/datasets/organizer.py +2145 -0
- mblt_vision/utils/datasets/readiness.py +1063 -0
- mblt_vision/utils/evaluation/__init__.py +51 -0
- mblt_vision/utils/evaluation/_result.py +22 -0
- mblt_vision/utils/evaluation/eval_ade20k.py +302 -0
- mblt_vision/utils/evaluation/eval_cityscapes.py +32 -0
- mblt_vision/utils/evaluation/eval_coco.py +465 -0
- mblt_vision/utils/evaluation/eval_dota.py +878 -0
- mblt_vision/utils/evaluation/eval_imagenet.py +151 -0
- mblt_vision/utils/evaluation/eval_nyu_depth.py +189 -0
- mblt_vision/utils/evaluation/eval_widerface.py +440 -0
- mblt_vision/utils/letterbox.py +118 -0
- mblt_vision/utils/postprocess/__init__.py +9 -0
- mblt_vision/utils/postprocess/_letterbox.py +102 -0
- mblt_vision/utils/postprocess/base.py +743 -0
- mblt_vision/utils/postprocess/build_post.py +120 -0
- mblt_vision/utils/postprocess/cls_post.py +117 -0
- mblt_vision/utils/postprocess/common.py +1571 -0
- mblt_vision/utils/postprocess/depth_post.py +106 -0
- mblt_vision/utils/postprocess/semantic_seg_post.py +192 -0
- mblt_vision/utils/postprocess/yolo_anchor_post.py +469 -0
- mblt_vision/utils/postprocess/yolo_anchorless_post.py +952 -0
- mblt_vision/utils/postprocess/yolo_dflfree_post.py +983 -0
- mblt_vision/utils/postprocess/yolo_nmsfree_post.py +176 -0
- mblt_vision/utils/preprocess/__init__.py +27 -0
- mblt_vision/utils/preprocess/_validation.py +66 -0
- mblt_vision/utils/preprocess/base.py +157 -0
- mblt_vision/utils/preprocess/build_pre.py +48 -0
- mblt_vision/utils/preprocess/center_crop.py +75 -0
- mblt_vision/utils/preprocess/letterbox.py +123 -0
- mblt_vision/utils/preprocess/normalize.py +94 -0
- mblt_vision/utils/preprocess/order.py +74 -0
- mblt_vision/utils/preprocess/reader.py +94 -0
- mblt_vision/utils/preprocess/resize.py +202 -0
- mblt_vision/utils/preprocess/yolo_pre.py +7 -0
- mblt_vision/utils/results.py +725 -0
- mblt_vision/utils/types.py +15 -0
- mblt_vision/wrapper.py +1121 -0
- mblt_vision_python-0.0.0.dist-info/METADATA +152 -0
- mblt_vision_python-0.0.0.dist-info/RECORD +404 -0
- mblt_vision_python-0.0.0.dist-info/WHEEL +5 -0
- mblt_vision_python-0.0.0.dist-info/entry_points.txt +2 -0
- mblt_vision_python-0.0.0.dist-info/licenses/LICENSE +28 -0
- mblt_vision_python-0.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"""Object detection model exports."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .._compat import create_model_class
|
|
6
|
+
|
|
7
|
+
__all__: list[str] = [
|
|
8
|
+
"YOLO11l",
|
|
9
|
+
"YOLO11m",
|
|
10
|
+
"YOLO11n",
|
|
11
|
+
"YOLO11s",
|
|
12
|
+
"YOLO11x",
|
|
13
|
+
"YOLO12l",
|
|
14
|
+
"YOLO12m",
|
|
15
|
+
"YOLO12n",
|
|
16
|
+
"YOLO12s",
|
|
17
|
+
"YOLO12x",
|
|
18
|
+
"YOLO26l",
|
|
19
|
+
"YOLO26lDistill",
|
|
20
|
+
"YOLO26m",
|
|
21
|
+
"YOLO26mDistill",
|
|
22
|
+
"YOLO26n",
|
|
23
|
+
"YOLO26nDistill",
|
|
24
|
+
"YOLO26s",
|
|
25
|
+
"YOLO26sDistill",
|
|
26
|
+
"YOLO26x",
|
|
27
|
+
"YOLO26xDistill",
|
|
28
|
+
"YOLOv3",
|
|
29
|
+
"YOLOv3_spp",
|
|
30
|
+
"YOLOv3_sppu",
|
|
31
|
+
"YOLOv3_tiny",
|
|
32
|
+
"YOLOv3_tinyu",
|
|
33
|
+
"YOLOv3u",
|
|
34
|
+
"YOLOv5l",
|
|
35
|
+
"YOLOv5l6",
|
|
36
|
+
"YOLOv5l6u",
|
|
37
|
+
"YOLOv5lu",
|
|
38
|
+
"YOLOv5m",
|
|
39
|
+
"YOLOv5m6",
|
|
40
|
+
"YOLOv5m6u",
|
|
41
|
+
"YOLOv5mu",
|
|
42
|
+
"YOLOv5n",
|
|
43
|
+
"YOLOv5n6",
|
|
44
|
+
"YOLOv5n6u",
|
|
45
|
+
"YOLOv5nu",
|
|
46
|
+
"YOLOv5s",
|
|
47
|
+
"YOLOv5s6",
|
|
48
|
+
"YOLOv5s6u",
|
|
49
|
+
"YOLOv5su",
|
|
50
|
+
"YOLOv5x",
|
|
51
|
+
"YOLOv5x6",
|
|
52
|
+
"YOLOv5x6u",
|
|
53
|
+
"YOLOv5xu",
|
|
54
|
+
"YOLOv7",
|
|
55
|
+
"YOLOv7d6",
|
|
56
|
+
"YOLOv7e6",
|
|
57
|
+
"YOLOv7e6e",
|
|
58
|
+
"YOLOv7w6",
|
|
59
|
+
"YOLOv7x",
|
|
60
|
+
"YOLOv8l",
|
|
61
|
+
"YOLOv8m",
|
|
62
|
+
"YOLOv8n",
|
|
63
|
+
"YOLOv8s",
|
|
64
|
+
"YOLOv8x",
|
|
65
|
+
"GELANc",
|
|
66
|
+
"GELANe",
|
|
67
|
+
"GELANm",
|
|
68
|
+
"GELANs",
|
|
69
|
+
"YOLOv9c",
|
|
70
|
+
"YOLOv9e",
|
|
71
|
+
"YOLOv9m",
|
|
72
|
+
"YOLOv9s",
|
|
73
|
+
"YOLOv9t",
|
|
74
|
+
"YOLOv10b",
|
|
75
|
+
"YOLOv10l",
|
|
76
|
+
"YOLOv10m",
|
|
77
|
+
"YOLOv10n",
|
|
78
|
+
"YOLOv10s",
|
|
79
|
+
"YOLOv10x",
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
YOLO11l = create_model_class("YOLO11l", __name__)
|
|
83
|
+
YOLO11m = create_model_class("YOLO11m", __name__)
|
|
84
|
+
YOLO11n = create_model_class("YOLO11n", __name__)
|
|
85
|
+
YOLO11s = create_model_class("YOLO11s", __name__)
|
|
86
|
+
YOLO11x = create_model_class("YOLO11x", __name__)
|
|
87
|
+
YOLO12l = create_model_class("YOLO12l", __name__)
|
|
88
|
+
YOLO12m = create_model_class("YOLO12m", __name__)
|
|
89
|
+
YOLO12n = create_model_class("YOLO12n", __name__)
|
|
90
|
+
YOLO12s = create_model_class("YOLO12s", __name__)
|
|
91
|
+
YOLO12x = create_model_class("YOLO12x", __name__)
|
|
92
|
+
YOLO26l = create_model_class("YOLO26l", __name__)
|
|
93
|
+
YOLO26lDistill = create_model_class("YOLO26lDistill", __name__)
|
|
94
|
+
YOLO26m = create_model_class("YOLO26m", __name__)
|
|
95
|
+
YOLO26mDistill = create_model_class("YOLO26mDistill", __name__)
|
|
96
|
+
YOLO26n = create_model_class("YOLO26n", __name__)
|
|
97
|
+
YOLO26nDistill = create_model_class("YOLO26nDistill", __name__)
|
|
98
|
+
YOLO26s = create_model_class("YOLO26s", __name__)
|
|
99
|
+
YOLO26sDistill = create_model_class("YOLO26sDistill", __name__)
|
|
100
|
+
YOLO26x = create_model_class("YOLO26x", __name__)
|
|
101
|
+
YOLO26xDistill = create_model_class("YOLO26xDistill", __name__)
|
|
102
|
+
YOLOv3 = create_model_class("YOLOv3", __name__)
|
|
103
|
+
YOLOv3_spp = create_model_class("YOLOv3_spp", __name__)
|
|
104
|
+
YOLOv3_sppu = create_model_class("YOLOv3_sppu", __name__)
|
|
105
|
+
YOLOv3_tiny = create_model_class("YOLOv3_tiny", __name__)
|
|
106
|
+
YOLOv3_tinyu = create_model_class("YOLOv3_tinyu", __name__)
|
|
107
|
+
YOLOv3u = create_model_class("YOLOv3u", __name__)
|
|
108
|
+
YOLOv5l = create_model_class("YOLOv5l", __name__)
|
|
109
|
+
YOLOv5l6 = create_model_class("YOLOv5l6", __name__)
|
|
110
|
+
YOLOv5l6u = create_model_class("YOLOv5l6u", __name__)
|
|
111
|
+
YOLOv5lu = create_model_class("YOLOv5lu", __name__)
|
|
112
|
+
YOLOv5m = create_model_class("YOLOv5m", __name__)
|
|
113
|
+
YOLOv5m6 = create_model_class("YOLOv5m6", __name__)
|
|
114
|
+
YOLOv5m6u = create_model_class("YOLOv5m6u", __name__)
|
|
115
|
+
YOLOv5mu = create_model_class("YOLOv5mu", __name__)
|
|
116
|
+
YOLOv5n = create_model_class("YOLOv5n", __name__)
|
|
117
|
+
YOLOv5n6 = create_model_class("YOLOv5n6", __name__)
|
|
118
|
+
YOLOv5n6u = create_model_class("YOLOv5n6u", __name__)
|
|
119
|
+
YOLOv5nu = create_model_class("YOLOv5nu", __name__)
|
|
120
|
+
YOLOv5s = create_model_class("YOLOv5s", __name__)
|
|
121
|
+
YOLOv5s6 = create_model_class("YOLOv5s6", __name__)
|
|
122
|
+
YOLOv5s6u = create_model_class("YOLOv5s6u", __name__)
|
|
123
|
+
YOLOv5su = create_model_class("YOLOv5su", __name__)
|
|
124
|
+
YOLOv5x = create_model_class("YOLOv5x", __name__)
|
|
125
|
+
YOLOv5x6 = create_model_class("YOLOv5x6", __name__)
|
|
126
|
+
YOLOv5x6u = create_model_class("YOLOv5x6u", __name__)
|
|
127
|
+
YOLOv5xu = create_model_class("YOLOv5xu", __name__)
|
|
128
|
+
YOLOv7 = create_model_class("YOLOv7", __name__)
|
|
129
|
+
YOLOv7d6 = create_model_class("YOLOv7d6", __name__)
|
|
130
|
+
YOLOv7e6 = create_model_class("YOLOv7e6", __name__)
|
|
131
|
+
YOLOv7e6e = create_model_class("YOLOv7e6e", __name__)
|
|
132
|
+
YOLOv7w6 = create_model_class("YOLOv7w6", __name__)
|
|
133
|
+
YOLOv7x = create_model_class("YOLOv7x", __name__)
|
|
134
|
+
YOLOv8l = create_model_class("YOLOv8l", __name__)
|
|
135
|
+
YOLOv8m = create_model_class("YOLOv8m", __name__)
|
|
136
|
+
YOLOv8n = create_model_class("YOLOv8n", __name__)
|
|
137
|
+
YOLOv8s = create_model_class("YOLOv8s", __name__)
|
|
138
|
+
YOLOv8x = create_model_class("YOLOv8x", __name__)
|
|
139
|
+
GELANc = create_model_class("GELANc", __name__)
|
|
140
|
+
GELANe = create_model_class("GELANe", __name__)
|
|
141
|
+
GELANm = create_model_class("GELANm", __name__)
|
|
142
|
+
GELANs = create_model_class("GELANs", __name__)
|
|
143
|
+
YOLOv9c = create_model_class("YOLOv9c", __name__)
|
|
144
|
+
YOLOv9e = create_model_class("YOLOv9e", __name__)
|
|
145
|
+
YOLOv9m = create_model_class("YOLOv9m", __name__)
|
|
146
|
+
YOLOv9s = create_model_class("YOLOv9s", __name__)
|
|
147
|
+
YOLOv9t = create_model_class("YOLOv9t", __name__)
|
|
148
|
+
YOLOv10b = create_model_class("YOLOv10b", __name__)
|
|
149
|
+
YOLOv10l = create_model_class("YOLOv10l", __name__)
|
|
150
|
+
YOLOv10m = create_model_class("YOLOv10m", __name__)
|
|
151
|
+
YOLOv10n = create_model_class("YOLOv10n", __name__)
|
|
152
|
+
YOLOv10s = create_model_class("YOLOv10s", __name__)
|
|
153
|
+
YOLOv10x = create_model_class("YOLOv10x", __name__)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Pose estimation model exports."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .._compat import create_model_class
|
|
6
|
+
|
|
7
|
+
__all__: list[str] = [
|
|
8
|
+
"YOLO11lPose",
|
|
9
|
+
"YOLO11mPose",
|
|
10
|
+
"YOLO11nPose",
|
|
11
|
+
"YOLO11sPose",
|
|
12
|
+
"YOLO11xPose",
|
|
13
|
+
"YOLO26lPose",
|
|
14
|
+
"YOLO26mPose",
|
|
15
|
+
"YOLO26nPose",
|
|
16
|
+
"YOLO26sPose",
|
|
17
|
+
"YOLO26xPose",
|
|
18
|
+
"YOLOv8lPose",
|
|
19
|
+
"YOLOv8mPose",
|
|
20
|
+
"YOLOv8nPose",
|
|
21
|
+
"YOLOv8sPose",
|
|
22
|
+
"YOLOv8xPose",
|
|
23
|
+
"YOLOv8xPoseP6",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
YOLO11lPose = create_model_class("YOLO11lPose", __name__)
|
|
27
|
+
YOLO11mPose = create_model_class("YOLO11mPose", __name__)
|
|
28
|
+
YOLO11nPose = create_model_class("YOLO11nPose", __name__)
|
|
29
|
+
YOLO11sPose = create_model_class("YOLO11sPose", __name__)
|
|
30
|
+
YOLO11xPose = create_model_class("YOLO11xPose", __name__)
|
|
31
|
+
YOLO26lPose = create_model_class("YOLO26lPose", __name__)
|
|
32
|
+
YOLO26mPose = create_model_class("YOLO26mPose", __name__)
|
|
33
|
+
YOLO26nPose = create_model_class("YOLO26nPose", __name__)
|
|
34
|
+
YOLO26sPose = create_model_class("YOLO26sPose", __name__)
|
|
35
|
+
YOLO26xPose = create_model_class("YOLO26xPose", __name__)
|
|
36
|
+
YOLOv8lPose = create_model_class("YOLOv8lPose", __name__)
|
|
37
|
+
YOLOv8mPose = create_model_class("YOLOv8mPose", __name__)
|
|
38
|
+
YOLOv8nPose = create_model_class("YOLOv8nPose", __name__)
|
|
39
|
+
YOLOv8sPose = create_model_class("YOLOv8sPose", __name__)
|
|
40
|
+
YOLOv8xPose = create_model_class("YOLOv8xPose", __name__)
|
|
41
|
+
YOLOv8xPoseP6 = create_model_class("YOLOv8xPoseP6", __name__)
|
mblt_vision/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# PEP 561 marker: mblt_vision ships inline type information.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Semantic segmentation model exports."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .._compat import create_model_class
|
|
6
|
+
|
|
7
|
+
__all__: list[str] = [
|
|
8
|
+
"YOLO26lSem",
|
|
9
|
+
"YOLO26lSemADE20K",
|
|
10
|
+
"YOLO26mSem",
|
|
11
|
+
"YOLO26mSemADE20K",
|
|
12
|
+
"YOLO26nSem",
|
|
13
|
+
"YOLO26nSemADE20K",
|
|
14
|
+
"YOLO26sSem",
|
|
15
|
+
"YOLO26sSemADE20K",
|
|
16
|
+
"YOLO26xSem",
|
|
17
|
+
"YOLO26xSemADE20K",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
YOLO26lSem = create_model_class("YOLO26lSem", __name__)
|
|
21
|
+
YOLO26lSemADE20K = create_model_class("YOLO26lSemADE20K", __name__)
|
|
22
|
+
YOLO26mSem = create_model_class("YOLO26mSem", __name__)
|
|
23
|
+
YOLO26mSemADE20K = create_model_class("YOLO26mSemADE20K", __name__)
|
|
24
|
+
YOLO26nSem = create_model_class("YOLO26nSem", __name__)
|
|
25
|
+
YOLO26nSemADE20K = create_model_class("YOLO26nSemADE20K", __name__)
|
|
26
|
+
YOLO26sSem = create_model_class("YOLO26sSem", __name__)
|
|
27
|
+
YOLO26sSemADE20K = create_model_class("YOLO26sSemADE20K", __name__)
|
|
28
|
+
YOLO26xSem = create_model_class("YOLO26xSem", __name__)
|
|
29
|
+
YOLO26xSemADE20K = create_model_class("YOLO26xSemADE20K", __name__)
|
|
File without changes
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Datasets utilities and loaders.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from .ade20k import get_ade20k_palette
|
|
8
|
+
from .cityscapes import get_cityscapes_palette
|
|
9
|
+
from .coco import (
|
|
10
|
+
get_coco_class_num,
|
|
11
|
+
get_coco_det_palette,
|
|
12
|
+
get_coco_inv,
|
|
13
|
+
get_coco_keypoint_palette,
|
|
14
|
+
get_coco_label,
|
|
15
|
+
get_coco_limb_palette,
|
|
16
|
+
get_coco_pose_skeleton,
|
|
17
|
+
)
|
|
18
|
+
from .dataloader import (
|
|
19
|
+
CustomADE20K,
|
|
20
|
+
CustomCityscapes,
|
|
21
|
+
CustomCocodata,
|
|
22
|
+
CustomCOCODataset,
|
|
23
|
+
CustomDOTAv1,
|
|
24
|
+
CustomImageFolder,
|
|
25
|
+
CustomNYUDepth,
|
|
26
|
+
CustomWiderface,
|
|
27
|
+
CustomWiderFaceDataset,
|
|
28
|
+
get_ade20k_loader,
|
|
29
|
+
get_cityscapes_loader,
|
|
30
|
+
get_coco_loader,
|
|
31
|
+
get_dota_loader,
|
|
32
|
+
get_imagenet_loader,
|
|
33
|
+
get_nyu_depth_loader,
|
|
34
|
+
get_widerface_loader,
|
|
35
|
+
)
|
|
36
|
+
from .dotav1 import get_dotav1_class_num, get_dotav1_label, get_dotav1_palette
|
|
37
|
+
from .imagenet import get_imagenet_label
|
|
38
|
+
from .organizer import (
|
|
39
|
+
organize_ade20k,
|
|
40
|
+
organize_cityscapes,
|
|
41
|
+
organize_coco,
|
|
42
|
+
organize_dotav1,
|
|
43
|
+
organize_imagenet,
|
|
44
|
+
organize_nyu_depth,
|
|
45
|
+
organize_widerface,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
__all__: list[str] = [
|
|
49
|
+
"get_ade20k_palette",
|
|
50
|
+
"get_cityscapes_palette",
|
|
51
|
+
"get_coco_class_num",
|
|
52
|
+
"get_coco_det_palette",
|
|
53
|
+
"get_coco_inv",
|
|
54
|
+
"get_coco_keypoint_palette",
|
|
55
|
+
"get_coco_label",
|
|
56
|
+
"get_coco_limb_palette",
|
|
57
|
+
"get_coco_pose_skeleton",
|
|
58
|
+
"get_dotav1_class_num",
|
|
59
|
+
"get_dotav1_label",
|
|
60
|
+
"get_dotav1_palette",
|
|
61
|
+
"CustomADE20K",
|
|
62
|
+
"CustomCityscapes",
|
|
63
|
+
"CustomCOCODataset",
|
|
64
|
+
"CustomCocodata",
|
|
65
|
+
"CustomDOTAv1",
|
|
66
|
+
"CustomImageFolder",
|
|
67
|
+
"CustomNYUDepth",
|
|
68
|
+
"CustomWiderFaceDataset",
|
|
69
|
+
"CustomWiderface",
|
|
70
|
+
"get_ade20k_loader",
|
|
71
|
+
"get_cityscapes_loader",
|
|
72
|
+
"get_coco_loader",
|
|
73
|
+
"get_dota_loader",
|
|
74
|
+
"get_imagenet_loader",
|
|
75
|
+
"get_nyu_depth_loader",
|
|
76
|
+
"get_widerface_loader",
|
|
77
|
+
"get_imagenet_label",
|
|
78
|
+
"organize_coco",
|
|
79
|
+
"organize_ade20k",
|
|
80
|
+
"organize_cityscapes",
|
|
81
|
+
"organize_dotav1",
|
|
82
|
+
"organize_imagenet",
|
|
83
|
+
"organize_nyu_depth",
|
|
84
|
+
"organize_widerface",
|
|
85
|
+
]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ADE20K dataset constants and utilities.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
ADE20K_PALETTE_BGR = [
|
|
8
|
+
(255, 42, 4),
|
|
9
|
+
(235, 219, 11),
|
|
10
|
+
(243, 243, 243),
|
|
11
|
+
(183, 223, 0),
|
|
12
|
+
(104, 31, 17),
|
|
13
|
+
(221, 111, 255),
|
|
14
|
+
(79, 68, 255),
|
|
15
|
+
(0, 237, 204),
|
|
16
|
+
(68, 243, 0),
|
|
17
|
+
(255, 0, 189),
|
|
18
|
+
(255, 180, 0),
|
|
19
|
+
(186, 0, 221),
|
|
20
|
+
(255, 255, 0),
|
|
21
|
+
(0, 192, 38),
|
|
22
|
+
(179, 255, 1),
|
|
23
|
+
(255, 36, 125),
|
|
24
|
+
(104, 0, 123),
|
|
25
|
+
(108, 27, 255),
|
|
26
|
+
(47, 109, 252),
|
|
27
|
+
(11, 255, 162),
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def get_ade20k_palette(idx: int) -> tuple[int, int, int]:
|
|
32
|
+
"""Get an ADE20K visualization color in OpenCV BGR order.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
idx: ADE20K class index.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
BGR color tuple. Colors repeat when the index exceeds the palette length.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
return ADE20K_PALETTE_BGR[idx % len(ADE20K_PALETTE_BGR)]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Cityscapes dataset visualization utilities."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
# OpenCV images use BGR channel order. These are the official Cityscapes train-ID
|
|
8
|
+
# colors converted from RGB so familiar classes retain their standard appearance.
|
|
9
|
+
CITYSCAPES_PALETTE_BGR: tuple[tuple[int, int, int], ...] = (
|
|
10
|
+
(128, 64, 128), # road
|
|
11
|
+
(232, 35, 244), # sidewalk
|
|
12
|
+
(70, 70, 70), # building
|
|
13
|
+
(156, 102, 102), # wall
|
|
14
|
+
(153, 153, 190), # fence
|
|
15
|
+
(153, 153, 153), # pole
|
|
16
|
+
(30, 170, 250), # traffic light
|
|
17
|
+
(0, 220, 220), # traffic sign
|
|
18
|
+
(35, 142, 107), # vegetation
|
|
19
|
+
(152, 251, 152), # terrain
|
|
20
|
+
(180, 130, 70), # sky
|
|
21
|
+
(60, 20, 220), # person
|
|
22
|
+
(0, 0, 255), # rider
|
|
23
|
+
(142, 0, 0), # car
|
|
24
|
+
(70, 0, 0), # truck
|
|
25
|
+
(100, 60, 0), # bus
|
|
26
|
+
(100, 80, 0), # train
|
|
27
|
+
(230, 0, 0), # motorcycle
|
|
28
|
+
(32, 11, 119), # bicycle
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
CITYSCAPES_SOURCE_IDS: tuple[int, ...] = (
|
|
32
|
+
7,
|
|
33
|
+
8,
|
|
34
|
+
11,
|
|
35
|
+
12,
|
|
36
|
+
13,
|
|
37
|
+
17,
|
|
38
|
+
*range(19, 29),
|
|
39
|
+
31,
|
|
40
|
+
32,
|
|
41
|
+
33,
|
|
42
|
+
)
|
|
43
|
+
CITYSCAPES_SOURCE_TO_TRAIN_ID = np.full(256, 255, dtype=np.uint8)
|
|
44
|
+
CITYSCAPES_SOURCE_TO_TRAIN_ID[list(CITYSCAPES_SOURCE_IDS)] = np.arange(
|
|
45
|
+
19, dtype=np.uint8
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def get_cityscapes_palette(class_id: int) -> tuple[int, int, int]:
|
|
50
|
+
"""Return the BGR visualization color for a Cityscapes train ID.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
class_id: Cityscapes train ID in the range 0 through 18.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
The corresponding color in OpenCV BGR order.
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
ValueError: If ``class_id`` is outside the Cityscapes train-ID range.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
if not 0 <= class_id < len(CITYSCAPES_PALETTE_BGR):
|
|
63
|
+
raise ValueError(
|
|
64
|
+
f"Cityscapes class ID must be in [0, {len(CITYSCAPES_PALETTE_BGR) - 1}]."
|
|
65
|
+
)
|
|
66
|
+
return CITYSCAPES_PALETTE_BGR[class_id]
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"""
|
|
2
|
+
COCO dataset constants and utilities.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from ...datasets import get_dataset_category_ids, get_dataset_class_names
|
|
8
|
+
|
|
9
|
+
DET_PALETTE = [
|
|
10
|
+
(220, 20, 60),
|
|
11
|
+
(119, 11, 32),
|
|
12
|
+
(0, 0, 142),
|
|
13
|
+
(0, 0, 230),
|
|
14
|
+
(106, 0, 228),
|
|
15
|
+
(0, 60, 100),
|
|
16
|
+
(0, 80, 100),
|
|
17
|
+
(0, 0, 70),
|
|
18
|
+
(0, 0, 192),
|
|
19
|
+
(250, 170, 30),
|
|
20
|
+
(100, 170, 30),
|
|
21
|
+
(220, 220, 0),
|
|
22
|
+
(175, 116, 175),
|
|
23
|
+
(250, 0, 30),
|
|
24
|
+
(165, 42, 42),
|
|
25
|
+
(255, 77, 255),
|
|
26
|
+
(0, 226, 252),
|
|
27
|
+
(182, 182, 255),
|
|
28
|
+
(0, 82, 0),
|
|
29
|
+
(120, 166, 157),
|
|
30
|
+
(110, 76, 0),
|
|
31
|
+
(174, 57, 255),
|
|
32
|
+
(199, 100, 0),
|
|
33
|
+
(72, 0, 118),
|
|
34
|
+
(255, 179, 240),
|
|
35
|
+
(0, 125, 92),
|
|
36
|
+
(209, 0, 151),
|
|
37
|
+
(188, 208, 182),
|
|
38
|
+
(0, 220, 176),
|
|
39
|
+
(255, 99, 164),
|
|
40
|
+
(92, 0, 73),
|
|
41
|
+
(133, 129, 255),
|
|
42
|
+
(78, 180, 255),
|
|
43
|
+
(0, 228, 0),
|
|
44
|
+
(174, 255, 243),
|
|
45
|
+
(45, 89, 255),
|
|
46
|
+
(134, 134, 103),
|
|
47
|
+
(145, 148, 174),
|
|
48
|
+
(255, 208, 186),
|
|
49
|
+
(197, 226, 255),
|
|
50
|
+
(171, 134, 1),
|
|
51
|
+
(109, 63, 54),
|
|
52
|
+
(207, 138, 255),
|
|
53
|
+
(151, 0, 95),
|
|
54
|
+
(9, 80, 61),
|
|
55
|
+
(84, 105, 51),
|
|
56
|
+
(74, 65, 105),
|
|
57
|
+
(166, 196, 102),
|
|
58
|
+
(208, 195, 210),
|
|
59
|
+
(255, 109, 65),
|
|
60
|
+
(0, 143, 149),
|
|
61
|
+
(179, 0, 194),
|
|
62
|
+
(209, 99, 106),
|
|
63
|
+
(5, 121, 0),
|
|
64
|
+
(227, 255, 205),
|
|
65
|
+
(147, 186, 208),
|
|
66
|
+
(153, 69, 1),
|
|
67
|
+
(3, 95, 161),
|
|
68
|
+
(163, 255, 0),
|
|
69
|
+
(119, 0, 170),
|
|
70
|
+
(0, 182, 199),
|
|
71
|
+
(0, 165, 120),
|
|
72
|
+
(183, 130, 88),
|
|
73
|
+
(95, 32, 0),
|
|
74
|
+
(130, 114, 135),
|
|
75
|
+
(110, 129, 133),
|
|
76
|
+
(166, 74, 118),
|
|
77
|
+
(219, 142, 185),
|
|
78
|
+
(79, 210, 114),
|
|
79
|
+
(178, 90, 62),
|
|
80
|
+
(65, 70, 15),
|
|
81
|
+
(127, 167, 115),
|
|
82
|
+
(59, 105, 106),
|
|
83
|
+
(142, 108, 45),
|
|
84
|
+
(196, 172, 0),
|
|
85
|
+
(95, 54, 80),
|
|
86
|
+
(128, 76, 255),
|
|
87
|
+
(201, 57, 1),
|
|
88
|
+
(246, 0, 122),
|
|
89
|
+
(191, 162, 208),
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
POSE_PALETTE = [
|
|
93
|
+
[255, 128, 0],
|
|
94
|
+
[255, 153, 51],
|
|
95
|
+
[255, 178, 102],
|
|
96
|
+
[230, 230, 0],
|
|
97
|
+
[255, 153, 255],
|
|
98
|
+
[153, 204, 255],
|
|
99
|
+
[255, 102, 255],
|
|
100
|
+
[255, 51, 255],
|
|
101
|
+
[102, 178, 255],
|
|
102
|
+
[51, 153, 255],
|
|
103
|
+
[255, 153, 153],
|
|
104
|
+
[255, 102, 102],
|
|
105
|
+
[255, 51, 51],
|
|
106
|
+
[153, 255, 153],
|
|
107
|
+
[102, 255, 102],
|
|
108
|
+
[51, 255, 51],
|
|
109
|
+
[0, 255, 0],
|
|
110
|
+
[0, 0, 255],
|
|
111
|
+
[255, 0, 0],
|
|
112
|
+
[255, 255, 255],
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
POSE_SKELETON = [
|
|
116
|
+
[16, 14],
|
|
117
|
+
[14, 12],
|
|
118
|
+
[17, 15],
|
|
119
|
+
[15, 13],
|
|
120
|
+
[12, 13],
|
|
121
|
+
[6, 12],
|
|
122
|
+
[7, 13],
|
|
123
|
+
[6, 7],
|
|
124
|
+
[6, 8],
|
|
125
|
+
[7, 9],
|
|
126
|
+
[8, 10],
|
|
127
|
+
[9, 11],
|
|
128
|
+
[2, 3],
|
|
129
|
+
[1, 2],
|
|
130
|
+
[1, 3],
|
|
131
|
+
[2, 4],
|
|
132
|
+
[3, 5],
|
|
133
|
+
[4, 6],
|
|
134
|
+
[5, 7],
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
LIMB_PALETTE = [
|
|
138
|
+
POSE_PALETTE[i]
|
|
139
|
+
for i in [9, 9, 9, 9, 7, 7, 7, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16]
|
|
140
|
+
]
|
|
141
|
+
KEYPOINT_PALETTE = [
|
|
142
|
+
POSE_PALETTE[i] for i in [16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9]
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def get_coco_class_num() -> int:
|
|
147
|
+
"""Get the number of COCO classes.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
int: The number of COCO classes.
|
|
151
|
+
"""
|
|
152
|
+
return len(get_dataset_class_names("coco"))
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def get_coco_label(idx: int) -> str:
|
|
156
|
+
"""
|
|
157
|
+
Get the COCO class label for a given index.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
idx (int): Zero-based class index.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
str: Descriptive label for the class (e.g., "person").
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
ValueError: If index is out of range.
|
|
167
|
+
"""
|
|
168
|
+
if not 0 <= idx < get_coco_class_num():
|
|
169
|
+
raise ValueError(
|
|
170
|
+
f"COCO class index must be in [0, {get_coco_class_num() - 1}], got {idx}."
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
return get_dataset_class_names("coco")[idx]
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def get_coco_inv(idx: int) -> int:
|
|
177
|
+
"""Get the original COCO category ID for a given model output index.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
idx (int): Model output class index.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
int: Original COCO category ID.
|
|
184
|
+
"""
|
|
185
|
+
return get_dataset_category_ids("coco")[idx]
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def get_coco_det_palette(idx: int) -> tuple[int, int, int]:
|
|
189
|
+
"""
|
|
190
|
+
Get a distinct color for a COCO detection class.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
idx (int): Class index.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
tuple[int, int, int]: (R, G, B) color tuple.
|
|
197
|
+
"""
|
|
198
|
+
return DET_PALETTE[idx]
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def get_coco_pose_palette(idx: int) -> list[int]:
|
|
202
|
+
"""Get the COCO pose palette by index.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
idx (int): The index of the COCO pose palette.
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
list[int]: The COCO pose palette as an [R, G, B] list.
|
|
209
|
+
"""
|
|
210
|
+
return POSE_PALETTE[idx]
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def get_coco_pose_skeleton() -> list[list[int]]:
|
|
214
|
+
"""Get the COCO pose skeleton.
|
|
215
|
+
|
|
216
|
+
Returns:
|
|
217
|
+
list[list[int]]: The COCO pose skeleton.
|
|
218
|
+
"""
|
|
219
|
+
return POSE_SKELETON
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def get_coco_limb_palette(idx: int) -> list[int]:
|
|
223
|
+
"""Get the COCO limb palette by index.
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
idx (int): The index of the COCO limb palette.
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
list[int]: The COCO limb palette as an [R, G, B] list.
|
|
230
|
+
"""
|
|
231
|
+
return LIMB_PALETTE[idx]
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def get_coco_keypoint_palette(idx: int) -> list[int]:
|
|
235
|
+
"""Get the COCO keypoint palette by index.
|
|
236
|
+
|
|
237
|
+
Args:
|
|
238
|
+
idx (int): The index of the COCO keypoint palette.
|
|
239
|
+
|
|
240
|
+
Returns:
|
|
241
|
+
list[int]: The COCO keypoint palette as an [R, G, B] list.
|
|
242
|
+
"""
|
|
243
|
+
return KEYPOINT_PALETTE[idx]
|