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,151 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Evaluation script for ImageNet dataset.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import math
|
|
8
|
+
from time import time
|
|
9
|
+
from typing import TYPE_CHECKING, NamedTuple
|
|
10
|
+
|
|
11
|
+
import numpy as np
|
|
12
|
+
import torch
|
|
13
|
+
from tqdm import tqdm
|
|
14
|
+
|
|
15
|
+
from ..datasets import CustomImageFolder, get_imagenet_loader
|
|
16
|
+
from ..datasets.readiness import IMAGENET_SYNSET_ORDER, IMAGENET_SYNSETS
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from ...wrapper import MBLT_Engine
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ImageNetResult(NamedTuple):
|
|
23
|
+
"""ImageNet metrics ordered from primary to secondary."""
|
|
24
|
+
|
|
25
|
+
top1: float
|
|
26
|
+
top5: float
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def primary_score(self) -> float:
|
|
30
|
+
"""Return the primary ImageNet validation metric."""
|
|
31
|
+
return self.top1
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def secondary_score(self) -> float:
|
|
35
|
+
"""Return the secondary ImageNet validation metric."""
|
|
36
|
+
return self.top5
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def eval_imagenet_metrics(
|
|
40
|
+
model: MBLT_Engine, data_path: str, batch_size: int
|
|
41
|
+
) -> ImageNetResult:
|
|
42
|
+
"""Evaluates a classification model on the ImageNet validation set.
|
|
43
|
+
|
|
44
|
+
Computes Top-1 and Top-5 accuracy and inference speed (FPS) on the NPU.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
model (MBLT_Engine): The vision engine to evaluate.
|
|
48
|
+
data_path (str): Path to the ImageNet validation images.
|
|
49
|
+
batch_size (int): Number of images per inference batch.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
ImageNetResult: Top-1 primary accuracy and Top-5 secondary accuracy.
|
|
53
|
+
"""
|
|
54
|
+
dataset_name = model.post_cfg.get("dataset")
|
|
55
|
+
if not isinstance(dataset_name, str) or dataset_name.lower() != "imagenet":
|
|
56
|
+
raise ValueError(
|
|
57
|
+
"ImageNet evaluation requires model post_cfg.dataset to be 'imagenet', "
|
|
58
|
+
f"got {dataset_name!r}."
|
|
59
|
+
)
|
|
60
|
+
dataset = CustomImageFolder(data_path)
|
|
61
|
+
unknown_synsets = set(dataset.classes) - IMAGENET_SYNSETS
|
|
62
|
+
if unknown_synsets:
|
|
63
|
+
raise ValueError(
|
|
64
|
+
"ImageNet evaluation found non-canonical synset directories: "
|
|
65
|
+
f"{', '.join(sorted(unknown_synsets)[:5])}."
|
|
66
|
+
)
|
|
67
|
+
dataset.class_to_idx = {
|
|
68
|
+
synset: index
|
|
69
|
+
for index, synset in enumerate(IMAGENET_SYNSET_ORDER)
|
|
70
|
+
if synset in dataset.class_to_idx
|
|
71
|
+
}
|
|
72
|
+
dataset.make_dataset()
|
|
73
|
+
num_data = len(dataset)
|
|
74
|
+
if num_data == 0:
|
|
75
|
+
raise ValueError(
|
|
76
|
+
f"ImageNet evaluation dataset contains no supported images: {data_path}."
|
|
77
|
+
)
|
|
78
|
+
dataloader = get_imagenet_loader(dataset, batch_size, model.preprocess)
|
|
79
|
+
total_iter = math.ceil(num_data / batch_size)
|
|
80
|
+
pbar = tqdm(dataloader, total=total_iter, desc="Evaluating ImageNet")
|
|
81
|
+
inference_time = 0.0
|
|
82
|
+
cum_num_data = 0
|
|
83
|
+
cum_top1_correct = 0
|
|
84
|
+
cum_top5_correct = 0
|
|
85
|
+
top1_acc = 0.0
|
|
86
|
+
top5_acc = 0.0
|
|
87
|
+
for input_npu, label in pbar:
|
|
88
|
+
cum_num_data += len(label)
|
|
89
|
+
tic = time()
|
|
90
|
+
out_npu = model(input_npu)
|
|
91
|
+
inference_time += time() - tic
|
|
92
|
+
result = model.postprocess(out_npu)
|
|
93
|
+
output = result.output
|
|
94
|
+
label_array = np.asarray(label)
|
|
95
|
+
if not isinstance(output, (np.ndarray, torch.Tensor)):
|
|
96
|
+
raise TypeError(
|
|
97
|
+
f"Expected classification output to be a tensor or ndarray, got {type(output)}."
|
|
98
|
+
)
|
|
99
|
+
if output.ndim != 2:
|
|
100
|
+
raise ValueError(
|
|
101
|
+
f"ImageNet classification output must have shape [B, C], got {tuple(output.shape)}."
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
output_batch_size = output.shape[0]
|
|
105
|
+
if output_batch_size != len(label_array):
|
|
106
|
+
raise ValueError(
|
|
107
|
+
"ImageNet classification output batch size does not match labels: "
|
|
108
|
+
f"got {output_batch_size} outputs for {len(label_array)} labels."
|
|
109
|
+
)
|
|
110
|
+
if isinstance(output, np.ndarray):
|
|
111
|
+
prediction = output.argmax(-1)
|
|
112
|
+
else:
|
|
113
|
+
prediction = output.argmax(-1).cpu().numpy()
|
|
114
|
+
top_k = min(5, output.shape[-1])
|
|
115
|
+
if isinstance(output, torch.Tensor):
|
|
116
|
+
top5_prediction = output.topk(top_k, dim=-1).indices.cpu().numpy()
|
|
117
|
+
else:
|
|
118
|
+
top5_prediction = np.argpartition(output, -top_k, axis=-1)[:, -top_k:]
|
|
119
|
+
cum_top1_correct += (prediction == label_array).sum().item()
|
|
120
|
+
cum_top5_correct += (
|
|
121
|
+
np.any(top5_prediction == label_array[:, np.newaxis], axis=-1).sum().item()
|
|
122
|
+
)
|
|
123
|
+
top1_acc = cum_top1_correct / cum_num_data
|
|
124
|
+
top5_acc = cum_top5_correct / cum_num_data
|
|
125
|
+
pbar.set_postfix_str(
|
|
126
|
+
f"Top 1 Acc.: {100 * top1_acc:.3f}%, Top 5 Acc.: {100 * top5_acc:.3f}%, "
|
|
127
|
+
f"NPU FPS: {cum_num_data / inference_time:.3f}"
|
|
128
|
+
)
|
|
129
|
+
pbar.close()
|
|
130
|
+
print("ImageNet evaluation completed")
|
|
131
|
+
print(
|
|
132
|
+
f"Top 1 Acc.: {100 * top1_acc:.3f}%, "
|
|
133
|
+
f"Top 5 Acc.: {100 * top5_acc:.3f}%, "
|
|
134
|
+
f"NPU FPS: {cum_num_data / inference_time:.3f}"
|
|
135
|
+
)
|
|
136
|
+
return ImageNetResult(top1=top1_acc, top5=top5_acc)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def eval_imagenet(model: MBLT_Engine, data_path: str, batch_size: int) -> float:
|
|
140
|
+
"""Evaluate ImageNet and return Top-1 accuracy for numeric API compatibility.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
model: Vision engine to evaluate.
|
|
144
|
+
data_path: Path to the ImageNet validation images.
|
|
145
|
+
batch_size: Number of images per inference batch.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
Top-1 accuracy in the range 0.0 to 1.0.
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
return eval_imagenet_metrics(model, data_path, batch_size).top1
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"""NYU Depth V2 evaluation for monocular depth-estimation models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
import numpy as np
|
|
9
|
+
from mblt_vision.utils.preprocess import build_preprocess
|
|
10
|
+
from tqdm import tqdm
|
|
11
|
+
|
|
12
|
+
from ..datasets import CustomNYUDepth, get_nyu_depth_loader
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ...wrapper import MBLT_Engine
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class NYUDepthResult:
|
|
20
|
+
"""Median-aligned NYU Depth V2 metrics."""
|
|
21
|
+
|
|
22
|
+
delta1: float
|
|
23
|
+
abs_rel: float
|
|
24
|
+
rmse: float
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def primary_score(self) -> float:
|
|
28
|
+
"""Return the primary NYU Depth validation metric."""
|
|
29
|
+
|
|
30
|
+
return self.delta1
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def secondary_score(self) -> float:
|
|
34
|
+
"""Return the secondary NYU Depth validation metric."""
|
|
35
|
+
|
|
36
|
+
return self.abs_rel
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class NYUDepthMetricAccumulator:
|
|
40
|
+
"""Accumulate median-aligned metrics over every valid NYU depth pixel."""
|
|
41
|
+
|
|
42
|
+
MIN_DEPTH = 0.001
|
|
43
|
+
MAX_DEPTH = 100.0
|
|
44
|
+
|
|
45
|
+
def __init__(self) -> None:
|
|
46
|
+
"""Initialize zero-valued pixel sums."""
|
|
47
|
+
|
|
48
|
+
self.delta1_sum = 0.0
|
|
49
|
+
self.abs_rel_sum = 0.0
|
|
50
|
+
self.squared_error_sum = 0.0
|
|
51
|
+
self.valid_pixel_count = 0
|
|
52
|
+
|
|
53
|
+
def update(self, prediction: np.ndarray, target: np.ndarray) -> None:
|
|
54
|
+
"""Median-align one prediction and add its valid-pixel statistics."""
|
|
55
|
+
|
|
56
|
+
prediction = _as_real_float32(prediction, "prediction")
|
|
57
|
+
target = _as_real_float32(target, "target")
|
|
58
|
+
if prediction.shape != target.shape:
|
|
59
|
+
raise ValueError(
|
|
60
|
+
f"NYU Depth prediction and target shapes must match, got {prediction.shape} and {target.shape}."
|
|
61
|
+
)
|
|
62
|
+
if not np.isfinite(target).all():
|
|
63
|
+
raise ValueError("NYU Depth target contains non-finite values.")
|
|
64
|
+
if (target < 0).any():
|
|
65
|
+
raise ValueError("NYU Depth target contains negative values.")
|
|
66
|
+
valid = (
|
|
67
|
+
np.isfinite(target) & (target > self.MIN_DEPTH) & (target < self.MAX_DEPTH)
|
|
68
|
+
)
|
|
69
|
+
valid_pixel_count = int(valid.sum())
|
|
70
|
+
if valid_pixel_count == 0:
|
|
71
|
+
raise ValueError(
|
|
72
|
+
"NYU Depth sample has no valid pixels in the (0.001, 100.0) range."
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
predicted, actual = prediction[valid], target[valid]
|
|
76
|
+
invalid_prediction_count = int((~np.isfinite(predicted)).sum())
|
|
77
|
+
if invalid_prediction_count:
|
|
78
|
+
raise ValueError(
|
|
79
|
+
f"NYU Depth prediction contains {invalid_prediction_count} non-finite value(s) at valid target pixels."
|
|
80
|
+
)
|
|
81
|
+
median_prediction = np.median(np.maximum(predicted, self.MIN_DEPTH))
|
|
82
|
+
median_target = np.median(actual)
|
|
83
|
+
aligned = predicted * (median_target / median_prediction)
|
|
84
|
+
aligned = np.clip(aligned, self.MIN_DEPTH, self.MAX_DEPTH)
|
|
85
|
+
ratio = np.maximum(actual / aligned, aligned / actual)
|
|
86
|
+
self.delta1_sum += float(np.sum(ratio < 1.25))
|
|
87
|
+
self.abs_rel_sum += float(np.sum(np.abs(actual - aligned) / actual))
|
|
88
|
+
self.squared_error_sum += float(np.sum((actual - aligned) ** 2))
|
|
89
|
+
self.valid_pixel_count += valid_pixel_count
|
|
90
|
+
|
|
91
|
+
def result(self) -> NYUDepthResult:
|
|
92
|
+
"""Return metrics pooled over all accumulated valid pixels."""
|
|
93
|
+
|
|
94
|
+
if self.valid_pixel_count == 0:
|
|
95
|
+
raise ValueError("NYU Depth evaluation received no valid pixels.")
|
|
96
|
+
return NYUDepthResult(
|
|
97
|
+
delta1=self.delta1_sum / self.valid_pixel_count,
|
|
98
|
+
abs_rel=self.abs_rel_sum / self.valid_pixel_count,
|
|
99
|
+
rmse=float(np.sqrt(self.squared_error_sum / self.valid_pixel_count)),
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _as_real_float32(values: np.ndarray, name: str) -> np.ndarray:
|
|
104
|
+
"""Validate metric input dtype before converting it to float32."""
|
|
105
|
+
|
|
106
|
+
array = np.asarray(values)
|
|
107
|
+
if not np.issubdtype(array.dtype, np.number) or np.issubdtype(
|
|
108
|
+
array.dtype, np.complexfloating
|
|
109
|
+
):
|
|
110
|
+
raise ValueError(
|
|
111
|
+
f"NYU Depth {name} must use a real numeric dtype, got {array.dtype}."
|
|
112
|
+
)
|
|
113
|
+
return np.asarray(array, dtype=np.float32)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def calculate_nyu_depth_metrics(
|
|
117
|
+
prediction: np.ndarray, target: np.ndarray
|
|
118
|
+
) -> NYUDepthResult:
|
|
119
|
+
"""Calculate official pooled metrics for one median-aligned NYU sample."""
|
|
120
|
+
|
|
121
|
+
accumulator = NYUDepthMetricAccumulator()
|
|
122
|
+
accumulator.update(prediction, target)
|
|
123
|
+
return accumulator.result()
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def eval_nyu_depth(
|
|
127
|
+
model: MBLT_Engine, data_path: str, batch_size: int
|
|
128
|
+
) -> NYUDepthResult:
|
|
129
|
+
"""Evaluate a depth model on paired NYU validation images and depth maps."""
|
|
130
|
+
|
|
131
|
+
dataset_name = model.post_cfg.get("dataset")
|
|
132
|
+
if not isinstance(dataset_name, str) or dataset_name.lower() != "nyu-depth":
|
|
133
|
+
raise ValueError(
|
|
134
|
+
"NYU Depth evaluation requires model post_cfg.dataset to be 'nyu-depth', "
|
|
135
|
+
f"got {dataset_name!r}."
|
|
136
|
+
)
|
|
137
|
+
dataset = CustomNYUDepth(data_path)
|
|
138
|
+
letterbox_cfg = model.pre_cfg.get("LetterBox")
|
|
139
|
+
if not isinstance(letterbox_cfg, dict) or "img_size" not in letterbox_cfg:
|
|
140
|
+
raise ValueError(
|
|
141
|
+
"NYU Depth validation requires a LetterBox img_size in the model preprocessing config."
|
|
142
|
+
)
|
|
143
|
+
image_size = letterbox_cfg["img_size"]
|
|
144
|
+
if not isinstance(image_size, list) or len(image_size) != 2:
|
|
145
|
+
raise ValueError(
|
|
146
|
+
"NYU Depth validation img_size must be a two-item [height, width] list."
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
validation_pre_cfg = {
|
|
150
|
+
name: config for name, config in model.pre_cfg.items() if name != "LetterBox"
|
|
151
|
+
}
|
|
152
|
+
validation_preprocessor = build_preprocess(validation_pre_cfg)
|
|
153
|
+
loader = get_nyu_depth_loader(
|
|
154
|
+
dataset,
|
|
155
|
+
batch_size,
|
|
156
|
+
validation_preprocessor,
|
|
157
|
+
image_size=(int(image_size[0]), int(image_size[1])),
|
|
158
|
+
)
|
|
159
|
+
accumulator = NYUDepthMetricAccumulator()
|
|
160
|
+
for inputs, targets, _, _, _ in tqdm(loader, desc="Evaluating NYU Depth"):
|
|
161
|
+
output = model(inputs)
|
|
162
|
+
result = model.postprocess(output)
|
|
163
|
+
depth = result.depth
|
|
164
|
+
if depth is None:
|
|
165
|
+
raise ValueError("Depth postprocessor returned no depth maps.")
|
|
166
|
+
if isinstance(depth, list):
|
|
167
|
+
maps = depth
|
|
168
|
+
elif len(targets) == 1 and depth.ndim == 2:
|
|
169
|
+
maps = [depth]
|
|
170
|
+
else:
|
|
171
|
+
if depth.ndim < 3 or depth.shape[0] != len(targets):
|
|
172
|
+
raise ValueError(
|
|
173
|
+
"Depth postprocessor output batch length mismatch: "
|
|
174
|
+
f"maps={depth.shape[0] if depth.ndim else 0}, "
|
|
175
|
+
f"targets={len(targets)}."
|
|
176
|
+
)
|
|
177
|
+
maps = [depth[index] for index in range(len(targets))]
|
|
178
|
+
if len(maps) != len(targets):
|
|
179
|
+
raise ValueError(
|
|
180
|
+
f"Depth postprocessor returned {len(maps)} maps for {len(targets)} targets."
|
|
181
|
+
)
|
|
182
|
+
for prediction, target in zip(maps, targets):
|
|
183
|
+
array = (
|
|
184
|
+
prediction.detach().cpu().numpy()
|
|
185
|
+
if hasattr(prediction, "detach")
|
|
186
|
+
else np.asarray(prediction)
|
|
187
|
+
)
|
|
188
|
+
accumulator.update(array, target)
|
|
189
|
+
return accumulator.result()
|