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,106 @@
|
|
|
1
|
+
"""Postprocessing for monocular depth-estimation models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Sequence
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import torch
|
|
9
|
+
import torch.nn.functional as functional
|
|
10
|
+
|
|
11
|
+
from ..letterbox import RatioPad
|
|
12
|
+
from ..types import ListTensorLike, TensorLike
|
|
13
|
+
from ._letterbox import crop_letterbox, get_letterbox_input_shape, resolve_ratio_pads
|
|
14
|
+
from .base import PostBase
|
|
15
|
+
from .common import normalize_image_shapes
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class DepthPost(PostBase):
|
|
19
|
+
"""Normalize depth outputs and undo letterbox padding when metadata is available."""
|
|
20
|
+
|
|
21
|
+
def __init__(self, pre_cfg: dict[str, Any], post_cfg: dict[str, Any]) -> None:
|
|
22
|
+
"""Initialize depth restoration from the model letterbox configuration."""
|
|
23
|
+
|
|
24
|
+
super().__init__()
|
|
25
|
+
del post_cfg
|
|
26
|
+
self.input_shape = get_letterbox_input_shape(
|
|
27
|
+
pre_cfg, "Depth estimation", "Depth"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
def __call__(
|
|
31
|
+
self,
|
|
32
|
+
x: TensorLike | ListTensorLike,
|
|
33
|
+
img0_shape: tuple[int, int] | Sequence[tuple[int, int]] | None = None,
|
|
34
|
+
ratio_pad: RatioPad | Sequence[RatioPad | None] | None = None,
|
|
35
|
+
**kwargs: Any,
|
|
36
|
+
) -> torch.Tensor | list[torch.Tensor]:
|
|
37
|
+
"""Return normalized depth maps, optionally restored to original image sizes."""
|
|
38
|
+
|
|
39
|
+
if kwargs:
|
|
40
|
+
raise TypeError(
|
|
41
|
+
f"Unexpected depth postprocess kwargs: {', '.join(sorted(kwargs))}"
|
|
42
|
+
)
|
|
43
|
+
depth = self._normalize_output(x)
|
|
44
|
+
if img0_shape is None:
|
|
45
|
+
return depth
|
|
46
|
+
|
|
47
|
+
shapes = normalize_image_shapes(img0_shape, depth.shape[0])
|
|
48
|
+
pads = resolve_ratio_pads(ratio_pad, depth.shape[0], shapes, self.input_shape)
|
|
49
|
+
restored = [
|
|
50
|
+
self._restore(depth[index], shapes[index], pads[index])
|
|
51
|
+
for index in range(depth.shape[0])
|
|
52
|
+
]
|
|
53
|
+
return restored[0] if len(restored) == 1 else restored
|
|
54
|
+
|
|
55
|
+
def _normalize_output(self, x: TensorLike | ListTensorLike) -> torch.Tensor:
|
|
56
|
+
"""Validate dense output and normalize it to input-sized ``[B, H, W]`` tensors."""
|
|
57
|
+
|
|
58
|
+
if isinstance(x, (list, tuple)):
|
|
59
|
+
if len(x) != 1:
|
|
60
|
+
raise ValueError(
|
|
61
|
+
f"Depth estimation expects one output tensor, received {len(x)}."
|
|
62
|
+
)
|
|
63
|
+
x = x[0]
|
|
64
|
+
depth = torch.as_tensor(x)
|
|
65
|
+
if depth.ndim == 4:
|
|
66
|
+
if depth.shape[1] == 1:
|
|
67
|
+
depth = depth[:, 0]
|
|
68
|
+
elif depth.shape[-1] == 1:
|
|
69
|
+
depth = depth[..., 0]
|
|
70
|
+
else:
|
|
71
|
+
raise ValueError(
|
|
72
|
+
f"Depth estimation expects [B, 1, H, W] or [B, H, W, 1], got {tuple(depth.shape)}."
|
|
73
|
+
)
|
|
74
|
+
elif depth.ndim == 3 and depth.shape[-1] == 1:
|
|
75
|
+
depth = depth[..., 0].unsqueeze(0)
|
|
76
|
+
elif depth.ndim != 3:
|
|
77
|
+
raise ValueError(
|
|
78
|
+
"Depth estimation expects [B, H, W], [B, 1, H, W], [H, W, 1], or [B, H, W, 1], "
|
|
79
|
+
f"got {tuple(depth.shape)}."
|
|
80
|
+
)
|
|
81
|
+
depth = depth.to(device=self.device, dtype=torch.float32)
|
|
82
|
+
if not bool(torch.isfinite(depth).all()):
|
|
83
|
+
raise ValueError("Depth estimation output must contain only finite values.")
|
|
84
|
+
if tuple(depth.shape[-2:]) == self.input_shape:
|
|
85
|
+
return depth
|
|
86
|
+
|
|
87
|
+
quarter_shape = tuple(dimension // 4 for dimension in self.input_shape)
|
|
88
|
+
if tuple(depth.shape[-2:]) == quarter_shape:
|
|
89
|
+
return functional.interpolate(
|
|
90
|
+
depth[:, None], scale_factor=4.0, mode="bilinear", align_corners=False
|
|
91
|
+
)[:, 0]
|
|
92
|
+
|
|
93
|
+
raise ValueError(
|
|
94
|
+
f"Depth estimation output spatial shape must be {self.input_shape} or quarter-resolution {quarter_shape}, "
|
|
95
|
+
f"got {tuple(depth.shape[-2:])}."
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
def _restore(
|
|
99
|
+
self, depth: torch.Tensor, shape: tuple[int, int], ratio_pad: RatioPad
|
|
100
|
+
) -> torch.Tensor:
|
|
101
|
+
"""Crop padded depth pixels and bilinearly resize to an original image shape."""
|
|
102
|
+
|
|
103
|
+
cropped = crop_letterbox(depth, shape, ratio_pad, self.input_shape, "Depth")
|
|
104
|
+
return functional.interpolate(
|
|
105
|
+
cropped[None, None], size=shape, mode="bilinear", align_corners=False
|
|
106
|
+
)[0, 0]
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"""Postprocessing for semantic-segmentation models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Sequence
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import torch
|
|
9
|
+
import torch.nn.functional as functional
|
|
10
|
+
|
|
11
|
+
from ..letterbox import RatioPad
|
|
12
|
+
from ..types import ListTensorLike, TensorLike
|
|
13
|
+
from ._letterbox import crop_letterbox, get_letterbox_input_shape, resolve_ratio_pads
|
|
14
|
+
from .base import PostBase
|
|
15
|
+
from .common import normalize_image_shapes
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SemanticSegPost(PostBase):
|
|
19
|
+
"""Convert semantic logits to class maps and undo letterbox padding."""
|
|
20
|
+
|
|
21
|
+
NC_BY_DATASET: dict[str, int] = {
|
|
22
|
+
"ade20k": 150,
|
|
23
|
+
"cityscapes": 19,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def __init__(self, pre_cfg: dict[str, Any], post_cfg: dict[str, Any]) -> None:
|
|
27
|
+
"""Initialize semantic output handling for a configured dataset taxonomy."""
|
|
28
|
+
|
|
29
|
+
super().__init__()
|
|
30
|
+
self.input_shape = get_letterbox_input_shape(
|
|
31
|
+
pre_cfg, "Semantic segmentation", "Semantic"
|
|
32
|
+
)
|
|
33
|
+
dataset = post_cfg.get("dataset")
|
|
34
|
+
if not isinstance(dataset, str):
|
|
35
|
+
raise ValueError(
|
|
36
|
+
"Semantic segmentation requires a string dataset in post_cfg."
|
|
37
|
+
)
|
|
38
|
+
self.dataset = dataset.lower()
|
|
39
|
+
dataset_nc = self.NC_BY_DATASET.get(self.dataset)
|
|
40
|
+
configured_nc = post_cfg.get("nc")
|
|
41
|
+
if configured_nc is None:
|
|
42
|
+
if dataset_nc is None:
|
|
43
|
+
raise ValueError(
|
|
44
|
+
f"Semantic segmentation requires nc for unknown dataset '{self.dataset}'."
|
|
45
|
+
)
|
|
46
|
+
self.nc = dataset_nc
|
|
47
|
+
else:
|
|
48
|
+
self.nc = int(configured_nc)
|
|
49
|
+
if dataset_nc is not None and self.nc != dataset_nc:
|
|
50
|
+
raise ValueError(
|
|
51
|
+
f"nc={configured_nc} conflicts with semantic dataset '{self.dataset}', which requires nc={dataset_nc}."
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
def __call__(
|
|
55
|
+
self,
|
|
56
|
+
x: TensorLike | ListTensorLike,
|
|
57
|
+
img0_shape: tuple[int, int] | Sequence[tuple[int, int]] | None = None,
|
|
58
|
+
ratio_pad: RatioPad | Sequence[RatioPad | None] | None = None,
|
|
59
|
+
**kwargs: Any,
|
|
60
|
+
) -> torch.Tensor | list[torch.Tensor]:
|
|
61
|
+
"""Return class maps, optionally restored to original image sizes."""
|
|
62
|
+
|
|
63
|
+
if kwargs:
|
|
64
|
+
raise TypeError(
|
|
65
|
+
f"Unexpected semantic postprocess kwargs: {', '.join(sorted(kwargs))}"
|
|
66
|
+
)
|
|
67
|
+
output, is_logits = self._normalize_output(x)
|
|
68
|
+
if img0_shape is None:
|
|
69
|
+
return self._to_input_space(output, is_logits)
|
|
70
|
+
|
|
71
|
+
shapes = normalize_image_shapes(img0_shape, output.shape[0])
|
|
72
|
+
pads = resolve_ratio_pads(ratio_pad, output.shape[0], shapes, self.input_shape)
|
|
73
|
+
restored = [
|
|
74
|
+
self._restore(output[index], is_logits, shapes[index], pads[index])
|
|
75
|
+
for index in range(output.shape[0])
|
|
76
|
+
]
|
|
77
|
+
return restored[0] if len(restored) == 1 else restored
|
|
78
|
+
|
|
79
|
+
def _normalize_output(
|
|
80
|
+
self, x: TensorLike | ListTensorLike
|
|
81
|
+
) -> tuple[torch.Tensor, bool]:
|
|
82
|
+
"""Validate logits in NCHW/NHWC layout or a baked class-map tensor."""
|
|
83
|
+
|
|
84
|
+
if isinstance(x, (list, tuple)):
|
|
85
|
+
if len(x) != 1:
|
|
86
|
+
raise ValueError(
|
|
87
|
+
f"Semantic segmentation expects one output tensor, received {len(x)}."
|
|
88
|
+
)
|
|
89
|
+
x = x[0]
|
|
90
|
+
output = torch.as_tensor(x, device=self.device)
|
|
91
|
+
if output.ndim == 4:
|
|
92
|
+
if output.shape[1] == self.nc:
|
|
93
|
+
return self._validate_logits(output), True
|
|
94
|
+
if output.shape[-1] == self.nc:
|
|
95
|
+
return self._validate_logits(output.permute(0, 3, 1, 2)), True
|
|
96
|
+
raise ValueError(
|
|
97
|
+
f"Semantic segmentation for '{self.dataset}' expects [B, {self.nc}, H, W] or "
|
|
98
|
+
f"[B, H, W, {self.nc}] logits, got {tuple(output.shape)}."
|
|
99
|
+
)
|
|
100
|
+
if output.ndim == 3:
|
|
101
|
+
if output.shape[-1] == self.nc and output.is_floating_point():
|
|
102
|
+
return self._validate_logits(output.permute(2, 0, 1).unsqueeze(0)), True
|
|
103
|
+
if tuple(output.shape[:2]) == self.input_shape:
|
|
104
|
+
raise ValueError(
|
|
105
|
+
f"Semantic segmentation for '{self.dataset}' expects [H, W, {self.nc}] MXQ logits, "
|
|
106
|
+
f"got {tuple(output.shape)}."
|
|
107
|
+
)
|
|
108
|
+
if output.is_complex():
|
|
109
|
+
raise ValueError("Semantic class-map values must be finite integers.")
|
|
110
|
+
if output.is_floating_point():
|
|
111
|
+
if not bool(torch.isfinite(output).all()):
|
|
112
|
+
raise ValueError("Semantic class-map values must be finite.")
|
|
113
|
+
if not bool(torch.eq(output, output.trunc()).all()):
|
|
114
|
+
raise ValueError(
|
|
115
|
+
"Semantic class-map values must be integer-valued."
|
|
116
|
+
)
|
|
117
|
+
if output.numel() and (
|
|
118
|
+
int(output.min()) < 0 or int(output.max()) >= self.nc
|
|
119
|
+
):
|
|
120
|
+
raise ValueError(
|
|
121
|
+
f"Semantic class-map values must be in [0, {self.nc - 1}]."
|
|
122
|
+
)
|
|
123
|
+
return output.to(dtype=torch.int64), False
|
|
124
|
+
raise ValueError(
|
|
125
|
+
f"Semantic segmentation expects [B, C, H, W] or [B, H, W, C] logits, or [B, H, W] class maps, "
|
|
126
|
+
f"got {tuple(output.shape)}."
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
@staticmethod
|
|
130
|
+
def _validate_logits(output: torch.Tensor) -> torch.Tensor:
|
|
131
|
+
"""Convert semantic logits to float while rejecting invalid artifact output."""
|
|
132
|
+
|
|
133
|
+
logits = output.to(dtype=torch.float32)
|
|
134
|
+
if not bool(torch.isfinite(logits).all()):
|
|
135
|
+
raise ValueError("Semantic logits must contain only finite values.")
|
|
136
|
+
return logits
|
|
137
|
+
|
|
138
|
+
def _to_input_space(self, output: torch.Tensor, is_logits: bool) -> torch.Tensor:
|
|
139
|
+
"""Restore model output resolution to configured input space."""
|
|
140
|
+
|
|
141
|
+
if is_logits:
|
|
142
|
+
if tuple(output.shape[-2:]) != self.input_shape:
|
|
143
|
+
output = functional.interpolate(
|
|
144
|
+
output, size=self.input_shape, mode="bilinear", align_corners=False
|
|
145
|
+
)
|
|
146
|
+
return output.argmax(dim=1).to(dtype=torch.int64)
|
|
147
|
+
if tuple(output.shape[-2:]) != self.input_shape:
|
|
148
|
+
output = functional.interpolate(
|
|
149
|
+
output[:, None].float(), size=self.input_shape, mode="nearest"
|
|
150
|
+
)[:, 0]
|
|
151
|
+
return output.to(dtype=torch.int64)
|
|
152
|
+
|
|
153
|
+
def _restore(
|
|
154
|
+
self,
|
|
155
|
+
output: torch.Tensor,
|
|
156
|
+
is_logits: bool,
|
|
157
|
+
shape: tuple[int, int],
|
|
158
|
+
ratio_pad: RatioPad,
|
|
159
|
+
) -> torch.Tensor:
|
|
160
|
+
"""Undo letterboxing, preserving logits until after bilinear restoration."""
|
|
161
|
+
|
|
162
|
+
if is_logits:
|
|
163
|
+
if tuple(output.shape[-2:]) != self.input_shape:
|
|
164
|
+
output = functional.interpolate(
|
|
165
|
+
output[None],
|
|
166
|
+
size=self.input_shape,
|
|
167
|
+
mode="bilinear",
|
|
168
|
+
align_corners=False,
|
|
169
|
+
)[0]
|
|
170
|
+
channels = [
|
|
171
|
+
crop_letterbox(channel, shape, ratio_pad, self.input_shape, "Semantic")
|
|
172
|
+
for channel in output
|
|
173
|
+
]
|
|
174
|
+
cropped_logits = torch.stack(channels)
|
|
175
|
+
restored_logits = functional.interpolate(
|
|
176
|
+
cropped_logits[None],
|
|
177
|
+
size=shape,
|
|
178
|
+
mode="bilinear",
|
|
179
|
+
align_corners=False,
|
|
180
|
+
)[0]
|
|
181
|
+
return restored_logits.argmax(dim=0).to(dtype=torch.int64)
|
|
182
|
+
|
|
183
|
+
if tuple(output.shape[-2:]) != self.input_shape:
|
|
184
|
+
output = functional.interpolate(
|
|
185
|
+
output[None, None].float(),
|
|
186
|
+
size=self.input_shape,
|
|
187
|
+
mode="nearest",
|
|
188
|
+
)[0, 0].to(dtype=torch.int64)
|
|
189
|
+
cropped = crop_letterbox(output, shape, ratio_pad, self.input_shape, "Semantic")
|
|
190
|
+
return functional.interpolate(
|
|
191
|
+
cropped[None, None].float(), size=shape, mode="nearest"
|
|
192
|
+
)[0, 0].to(torch.int64)
|