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.
Files changed (404) hide show
  1. mblt_vision/__init__.py +86 -0
  2. mblt_vision/_api.py +53 -0
  3. mblt_vision/_compat.py +227 -0
  4. mblt_vision/_model_paths.py +137 -0
  5. mblt_vision/_tasks.py +30 -0
  6. mblt_vision/benchmark/__init__.py +1 -0
  7. mblt_vision/benchmark/argparse_utils.py +106 -0
  8. mblt_vision/benchmark/chart_utils.py +146 -0
  9. mblt_vision/benchmark/io_utils.py +64 -0
  10. mblt_vision/benchmark/summary_utils.py +770 -0
  11. mblt_vision/cli/__init__.py +5 -0
  12. mblt_vision/cli/__main__.py +5 -0
  13. mblt_vision/cli/_vision.py +337 -0
  14. mblt_vision/cli/compile.py +117 -0
  15. mblt_vision/cli/main.py +35 -0
  16. mblt_vision/cli/predict.py +64 -0
  17. mblt_vision/cli/val.py +562 -0
  18. mblt_vision/compile/__init__.py +21 -0
  19. mblt_vision/compile/vision.py +1120 -0
  20. mblt_vision/datasets/__init__.py +15 -0
  21. mblt_vision/datasets/ade20k.yaml +164 -0
  22. mblt_vision/datasets/cityscapes.yaml +54 -0
  23. mblt_vision/datasets/coco.yaml +178 -0
  24. mblt_vision/datasets/dotav1.yaml +28 -0
  25. mblt_vision/datasets/imagenet.yaml +1019 -0
  26. mblt_vision/datasets/imagenet_synsets.txt +1000 -0
  27. mblt_vision/datasets/nyu-depth.yaml +7 -0
  28. mblt_vision/datasets/registry.py +158 -0
  29. mblt_vision/datasets/widerface.yaml +9 -0
  30. mblt_vision/depth_estimation/__init__.py +19 -0
  31. mblt_vision/face_detection/__init__.py +43 -0
  32. mblt_vision/image_classification/__init__.py +311 -0
  33. mblt_vision/instance_segmentation/__init__.py +65 -0
  34. mblt_vision/models/AlexNet.yaml +23 -0
  35. mblt_vision/models/CAFormer_B36.yaml +22 -0
  36. mblt_vision/models/CAFormer_M36.yaml +22 -0
  37. mblt_vision/models/CAFormer_S18.yaml +22 -0
  38. mblt_vision/models/CAFormer_S36.yaml +22 -0
  39. mblt_vision/models/CoAtNet_0_RW_224.yaml +22 -0
  40. mblt_vision/models/CoAtNet_1_RW_224.yaml +22 -0
  41. mblt_vision/models/CoAtNet_2_RW_224.yaml +22 -0
  42. mblt_vision/models/ConvFormer_B36.yaml +22 -0
  43. mblt_vision/models/ConvFormer_M36.yaml +22 -0
  44. mblt_vision/models/ConvFormer_S18.yaml +22 -0
  45. mblt_vision/models/ConvFormer_S36.yaml +22 -0
  46. mblt_vision/models/ConvNext_Base.yaml +23 -0
  47. mblt_vision/models/ConvNext_Large.yaml +23 -0
  48. mblt_vision/models/ConvNext_Small.yaml +23 -0
  49. mblt_vision/models/ConvNext_Tiny.yaml +23 -0
  50. mblt_vision/models/DeiT3_Base_Patch16_224.yaml +22 -0
  51. mblt_vision/models/DeiT3_Base_Patch16_384.yaml +22 -0
  52. mblt_vision/models/DeiT3_Large_Patch16_224.yaml +22 -0
  53. mblt_vision/models/DeiT3_Large_Patch16_384.yaml +22 -0
  54. mblt_vision/models/DeiT3_Medium_Patch16_224.yaml +22 -0
  55. mblt_vision/models/DeiT3_Small_Patch16_224.yaml +22 -0
  56. mblt_vision/models/DeiT3_Small_Patch16_384.yaml +22 -0
  57. mblt_vision/models/DeiT_Base_Patch16_224.yaml +22 -0
  58. mblt_vision/models/DeiT_Base_Patch16_384.yaml +22 -0
  59. mblt_vision/models/DeiT_Small_Patch16_224.yaml +22 -0
  60. mblt_vision/models/DeiT_Tiny_Patch16_224.yaml +22 -0
  61. mblt_vision/models/DenseNet121.yaml +23 -0
  62. mblt_vision/models/DenseNet161.yaml +23 -0
  63. mblt_vision/models/DenseNet169.yaml +23 -0
  64. mblt_vision/models/DenseNet201.yaml +23 -0
  65. mblt_vision/models/EfficientFormer_L1.yaml +22 -0
  66. mblt_vision/models/EfficientFormer_L3.yaml +22 -0
  67. mblt_vision/models/EfficientFormer_L7.yaml +22 -0
  68. mblt_vision/models/EfficientNet_B0.yaml +23 -0
  69. mblt_vision/models/EfficientNet_B1.yaml +32 -0
  70. mblt_vision/models/EfficientNet_B2.yaml +23 -0
  71. mblt_vision/models/EfficientNet_B3.yaml +23 -0
  72. mblt_vision/models/EfficientNet_B4.yaml +23 -0
  73. mblt_vision/models/EfficientNet_B5.yaml +23 -0
  74. mblt_vision/models/EfficientNet_B6.yaml +23 -0
  75. mblt_vision/models/EfficientNet_B7.yaml +23 -0
  76. mblt_vision/models/EfficientNet_V2_L.yaml +23 -0
  77. mblt_vision/models/EfficientNet_V2_M.yaml +23 -0
  78. mblt_vision/models/EfficientNet_V2_S.yaml +23 -0
  79. mblt_vision/models/FlexiVit_Base.yaml +22 -0
  80. mblt_vision/models/FlexiVit_Large.yaml +22 -0
  81. mblt_vision/models/FlexiVit_Small.yaml +22 -0
  82. mblt_vision/models/GELANc-seg.yaml +29 -0
  83. mblt_vision/models/GELANc.yaml +28 -0
  84. mblt_vision/models/GELANe.yaml +28 -0
  85. mblt_vision/models/GELANm.yaml +28 -0
  86. mblt_vision/models/GELANs.yaml +28 -0
  87. mblt_vision/models/GoogLeNet.yaml +23 -0
  88. mblt_vision/models/Inception_V3.yaml +23 -0
  89. mblt_vision/models/LeViT_Conv_128.yaml +22 -0
  90. mblt_vision/models/LeViT_Conv_128S.yaml +22 -0
  91. mblt_vision/models/LeViT_Conv_192.yaml +22 -0
  92. mblt_vision/models/LeViT_Conv_256.yaml +22 -0
  93. mblt_vision/models/LeViT_Conv_384.yaml +22 -0
  94. mblt_vision/models/MNASNet0_5.yaml +23 -0
  95. mblt_vision/models/MNASNet0_75.yaml +23 -0
  96. mblt_vision/models/MNASNet1_0.yaml +23 -0
  97. mblt_vision/models/MNASNet1_3.yaml +23 -0
  98. mblt_vision/models/MobileNet_V2.yaml +32 -0
  99. mblt_vision/models/MobileNet_V3_Large.yaml +32 -0
  100. mblt_vision/models/MobileNet_V3_Small.yaml +23 -0
  101. mblt_vision/models/RegNet_X_16GF.yaml +32 -0
  102. mblt_vision/models/RegNet_X_1_6GF.yaml +32 -0
  103. mblt_vision/models/RegNet_X_32GF.yaml +32 -0
  104. mblt_vision/models/RegNet_X_3_2GF.yaml +32 -0
  105. mblt_vision/models/RegNet_X_400MF.yaml +32 -0
  106. mblt_vision/models/RegNet_X_800MF.yaml +32 -0
  107. mblt_vision/models/RegNet_X_8GF.yaml +32 -0
  108. mblt_vision/models/RegNet_Y_16GF.yaml +76 -0
  109. mblt_vision/models/RegNet_Y_1_6GF.yaml +32 -0
  110. mblt_vision/models/RegNet_Y_32GF.yaml +76 -0
  111. mblt_vision/models/RegNet_Y_3_2GF.yaml +32 -0
  112. mblt_vision/models/RegNet_Y_400MF.yaml +32 -0
  113. mblt_vision/models/RegNet_Y_800MF.yaml +32 -0
  114. mblt_vision/models/RegNet_Y_8GF.yaml +32 -0
  115. mblt_vision/models/RepViT_M0_9.yaml +22 -0
  116. mblt_vision/models/RepViT_M1.yaml +22 -0
  117. mblt_vision/models/RepViT_M1_0.yaml +22 -0
  118. mblt_vision/models/RepViT_M1_1.yaml +22 -0
  119. mblt_vision/models/RepViT_M1_5.yaml +22 -0
  120. mblt_vision/models/RepViT_M2.yaml +22 -0
  121. mblt_vision/models/RepViT_M2_3.yaml +22 -0
  122. mblt_vision/models/RepViT_M3.yaml +22 -0
  123. mblt_vision/models/ResNeXt101_32X8D.yaml +32 -0
  124. mblt_vision/models/ResNeXt101_64X4D.yaml +23 -0
  125. mblt_vision/models/ResNeXt50_32X4D.yaml +32 -0
  126. mblt_vision/models/ResNet101.yaml +32 -0
  127. mblt_vision/models/ResNet152.yaml +32 -0
  128. mblt_vision/models/ResNet18.yaml +23 -0
  129. mblt_vision/models/ResNet34.yaml +23 -0
  130. mblt_vision/models/ResNet50.yaml +32 -0
  131. mblt_vision/models/ShuffleNet_V2_X0_5.yaml +23 -0
  132. mblt_vision/models/ShuffleNet_V2_X1_0.yaml +23 -0
  133. mblt_vision/models/ShuffleNet_V2_X1_5.yaml +23 -0
  134. mblt_vision/models/ShuffleNet_V2_X2_0.yaml +23 -0
  135. mblt_vision/models/SqueezeNet1_0.yaml +23 -0
  136. mblt_vision/models/SqueezeNet1_1.yaml +23 -0
  137. mblt_vision/models/Swin_B.yaml +23 -0
  138. mblt_vision/models/Swin_S.yaml +23 -0
  139. mblt_vision/models/Swin_T.yaml +23 -0
  140. mblt_vision/models/VGG11.yaml +23 -0
  141. mblt_vision/models/VGG11_BN.yaml +23 -0
  142. mblt_vision/models/VGG13.yaml +23 -0
  143. mblt_vision/models/VGG13_BN.yaml +23 -0
  144. mblt_vision/models/VGG16.yaml +23 -0
  145. mblt_vision/models/VGG16_BN.yaml +23 -0
  146. mblt_vision/models/VGG19.yaml +23 -0
  147. mblt_vision/models/VGG19_BN.yaml +23 -0
  148. mblt_vision/models/ViT_B_16.yaml +67 -0
  149. mblt_vision/models/ViT_B_32.yaml +23 -0
  150. mblt_vision/models/ViT_Base_Patch16_224.yaml +22 -0
  151. mblt_vision/models/ViT_Base_Patch16_384.yaml +22 -0
  152. mblt_vision/models/ViT_Base_Patch32_224.yaml +22 -0
  153. mblt_vision/models/ViT_Base_Patch32_384.yaml +22 -0
  154. mblt_vision/models/ViT_Base_Patch8_224.yaml +22 -0
  155. mblt_vision/models/ViT_L_16.yaml +67 -0
  156. mblt_vision/models/ViT_L_32.yaml +23 -0
  157. mblt_vision/models/ViT_Large_Patch16_224.yaml +22 -0
  158. mblt_vision/models/ViT_Large_Patch16_384.yaml +22 -0
  159. mblt_vision/models/ViT_Large_Patch32_384.yaml +22 -0
  160. mblt_vision/models/ViT_Small_Patch16_224.yaml +22 -0
  161. mblt_vision/models/ViT_Small_Patch16_384.yaml +22 -0
  162. mblt_vision/models/ViT_Small_Patch32_224.yaml +22 -0
  163. mblt_vision/models/ViT_Small_Patch32_384.yaml +22 -0
  164. mblt_vision/models/ViT_Tiny_Patch16_224.yaml +22 -0
  165. mblt_vision/models/ViT_Tiny_Patch16_384.yaml +22 -0
  166. mblt_vision/models/VisFormer_Small.yaml +22 -0
  167. mblt_vision/models/VisFormer_Tiny.yaml +22 -0
  168. mblt_vision/models/Wide_ResNet101_2.yaml +32 -0
  169. mblt_vision/models/Wide_ResNet50_2.yaml +32 -0
  170. mblt_vision/models/YOLO11l-cls.yaml +23 -0
  171. mblt_vision/models/YOLO11l-face.yaml +27 -0
  172. mblt_vision/models/YOLO11l-obb.yaml +28 -0
  173. mblt_vision/models/YOLO11l-pose.yaml +28 -0
  174. mblt_vision/models/YOLO11l-seg.yaml +28 -0
  175. mblt_vision/models/YOLO11l.yaml +27 -0
  176. mblt_vision/models/YOLO11m-cls.yaml +23 -0
  177. mblt_vision/models/YOLO11m-face.yaml +27 -0
  178. mblt_vision/models/YOLO11m-obb.yaml +28 -0
  179. mblt_vision/models/YOLO11m-pose.yaml +28 -0
  180. mblt_vision/models/YOLO11m-seg.yaml +28 -0
  181. mblt_vision/models/YOLO11m.yaml +27 -0
  182. mblt_vision/models/YOLO11n-cls.yaml +23 -0
  183. mblt_vision/models/YOLO11n-face.yaml +27 -0
  184. mblt_vision/models/YOLO11n-obb.yaml +28 -0
  185. mblt_vision/models/YOLO11n-pose.yaml +28 -0
  186. mblt_vision/models/YOLO11n-seg.yaml +28 -0
  187. mblt_vision/models/YOLO11n.yaml +27 -0
  188. mblt_vision/models/YOLO11s-cls.yaml +23 -0
  189. mblt_vision/models/YOLO11s-face.yaml +27 -0
  190. mblt_vision/models/YOLO11s-obb.yaml +28 -0
  191. mblt_vision/models/YOLO11s-pose.yaml +28 -0
  192. mblt_vision/models/YOLO11s-seg.yaml +28 -0
  193. mblt_vision/models/YOLO11s.yaml +27 -0
  194. mblt_vision/models/YOLO11x-cls.yaml +23 -0
  195. mblt_vision/models/YOLO11x-obb.yaml +28 -0
  196. mblt_vision/models/YOLO11x-pose.yaml +28 -0
  197. mblt_vision/models/YOLO11x-seg.yaml +28 -0
  198. mblt_vision/models/YOLO11x.yaml +27 -0
  199. mblt_vision/models/YOLO12l-face.yaml +27 -0
  200. mblt_vision/models/YOLO12l-seg.yaml +28 -0
  201. mblt_vision/models/YOLO12l.yaml +27 -0
  202. mblt_vision/models/YOLO12m-face.yaml +27 -0
  203. mblt_vision/models/YOLO12m-seg.yaml +28 -0
  204. mblt_vision/models/YOLO12m.yaml +27 -0
  205. mblt_vision/models/YOLO12n-face.yaml +27 -0
  206. mblt_vision/models/YOLO12n-seg.yaml +28 -0
  207. mblt_vision/models/YOLO12n.yaml +27 -0
  208. mblt_vision/models/YOLO12s-face.yaml +27 -0
  209. mblt_vision/models/YOLO12s-seg.yaml +28 -0
  210. mblt_vision/models/YOLO12s.yaml +27 -0
  211. mblt_vision/models/YOLO12x-seg.yaml +28 -0
  212. mblt_vision/models/YOLO12x.yaml +27 -0
  213. mblt_vision/models/YOLO26l-cls.yaml +23 -0
  214. mblt_vision/models/YOLO26l-depth.yaml +17 -0
  215. mblt_vision/models/YOLO26l-distill.yaml +27 -0
  216. mblt_vision/models/YOLO26l-obb.yaml +28 -0
  217. mblt_vision/models/YOLO26l-pose.yaml +28 -0
  218. mblt_vision/models/YOLO26l-seg.yaml +28 -0
  219. mblt_vision/models/YOLO26l-sem-ade20k.yaml +17 -0
  220. mblt_vision/models/YOLO26l-sem.yaml +17 -0
  221. mblt_vision/models/YOLO26l.yaml +27 -0
  222. mblt_vision/models/YOLO26m-cls.yaml +23 -0
  223. mblt_vision/models/YOLO26m-depth.yaml +17 -0
  224. mblt_vision/models/YOLO26m-distill.yaml +27 -0
  225. mblt_vision/models/YOLO26m-obb.yaml +28 -0
  226. mblt_vision/models/YOLO26m-pose.yaml +28 -0
  227. mblt_vision/models/YOLO26m-seg.yaml +28 -0
  228. mblt_vision/models/YOLO26m-sem-ade20k.yaml +17 -0
  229. mblt_vision/models/YOLO26m-sem.yaml +17 -0
  230. mblt_vision/models/YOLO26m.yaml +27 -0
  231. mblt_vision/models/YOLO26n-cls.yaml +23 -0
  232. mblt_vision/models/YOLO26n-depth.yaml +17 -0
  233. mblt_vision/models/YOLO26n-distill.yaml +27 -0
  234. mblt_vision/models/YOLO26n-obb.yaml +28 -0
  235. mblt_vision/models/YOLO26n-pose.yaml +28 -0
  236. mblt_vision/models/YOLO26n-seg.yaml +28 -0
  237. mblt_vision/models/YOLO26n-sem-ade20k.yaml +17 -0
  238. mblt_vision/models/YOLO26n-sem.yaml +17 -0
  239. mblt_vision/models/YOLO26n.yaml +27 -0
  240. mblt_vision/models/YOLO26s-cls.yaml +23 -0
  241. mblt_vision/models/YOLO26s-depth.yaml +17 -0
  242. mblt_vision/models/YOLO26s-distill.yaml +27 -0
  243. mblt_vision/models/YOLO26s-obb.yaml +28 -0
  244. mblt_vision/models/YOLO26s-pose.yaml +28 -0
  245. mblt_vision/models/YOLO26s-seg.yaml +28 -0
  246. mblt_vision/models/YOLO26s-sem-ade20k.yaml +17 -0
  247. mblt_vision/models/YOLO26s-sem.yaml +17 -0
  248. mblt_vision/models/YOLO26s.yaml +27 -0
  249. mblt_vision/models/YOLO26x-cls.yaml +23 -0
  250. mblt_vision/models/YOLO26x-depth.yaml +17 -0
  251. mblt_vision/models/YOLO26x-distill.yaml +27 -0
  252. mblt_vision/models/YOLO26x-obb.yaml +28 -0
  253. mblt_vision/models/YOLO26x-pose.yaml +28 -0
  254. mblt_vision/models/YOLO26x-seg.yaml +28 -0
  255. mblt_vision/models/YOLO26x-sem-ade20k.yaml +17 -0
  256. mblt_vision/models/YOLO26x-sem.yaml +17 -0
  257. mblt_vision/models/YOLO26x.yaml +27 -0
  258. mblt_vision/models/YOLOv10b.yaml +28 -0
  259. mblt_vision/models/YOLOv10l-face.yaml +28 -0
  260. mblt_vision/models/YOLOv10l.yaml +28 -0
  261. mblt_vision/models/YOLOv10m-face.yaml +28 -0
  262. mblt_vision/models/YOLOv10m.yaml +28 -0
  263. mblt_vision/models/YOLOv10n-face.yaml +28 -0
  264. mblt_vision/models/YOLOv10n.yaml +28 -0
  265. mblt_vision/models/YOLOv10s-face.yaml +28 -0
  266. mblt_vision/models/YOLOv10s.yaml +28 -0
  267. mblt_vision/models/YOLOv10x.yaml +28 -0
  268. mblt_vision/models/YOLOv3-spp.yaml +44 -0
  269. mblt_vision/models/YOLOv3-sppu.yaml +27 -0
  270. mblt_vision/models/YOLOv3-tiny.yaml +38 -0
  271. mblt_vision/models/YOLOv3-tinyu.yaml +27 -0
  272. mblt_vision/models/YOLOv3.yaml +44 -0
  273. mblt_vision/models/YOLOv3u.yaml +27 -0
  274. mblt_vision/models/YOLOv5l-cls.yaml +22 -0
  275. mblt_vision/models/YOLOv5l-seg.yaml +45 -0
  276. mblt_vision/models/YOLOv5l.yaml +44 -0
  277. mblt_vision/models/YOLOv5l6.yaml +50 -0
  278. mblt_vision/models/YOLOv5l6u.yaml +27 -0
  279. mblt_vision/models/YOLOv5lu.yaml +27 -0
  280. mblt_vision/models/YOLOv5m-cls.yaml +22 -0
  281. mblt_vision/models/YOLOv5m-seg.yaml +45 -0
  282. mblt_vision/models/YOLOv5m.yaml +45 -0
  283. mblt_vision/models/YOLOv5m6.yaml +50 -0
  284. mblt_vision/models/YOLOv5m6u.yaml +27 -0
  285. mblt_vision/models/YOLOv5mu.yaml +27 -0
  286. mblt_vision/models/YOLOv5n-cls.yaml +22 -0
  287. mblt_vision/models/YOLOv5n-seg.yaml +45 -0
  288. mblt_vision/models/YOLOv5n.yaml +44 -0
  289. mblt_vision/models/YOLOv5n6.yaml +50 -0
  290. mblt_vision/models/YOLOv5n6u.yaml +27 -0
  291. mblt_vision/models/YOLOv5nu.yaml +27 -0
  292. mblt_vision/models/YOLOv5s-cls.yaml +22 -0
  293. mblt_vision/models/YOLOv5s-seg.yaml +45 -0
  294. mblt_vision/models/YOLOv5s.yaml +44 -0
  295. mblt_vision/models/YOLOv5s6.yaml +50 -0
  296. mblt_vision/models/YOLOv5s6u.yaml +27 -0
  297. mblt_vision/models/YOLOv5su.yaml +27 -0
  298. mblt_vision/models/YOLOv5x-cls.yaml +22 -0
  299. mblt_vision/models/YOLOv5x-seg.yaml +45 -0
  300. mblt_vision/models/YOLOv5x.yaml +44 -0
  301. mblt_vision/models/YOLOv5x6.yaml +50 -0
  302. mblt_vision/models/YOLOv5x6u.yaml +27 -0
  303. mblt_vision/models/YOLOv5xu.yaml +27 -0
  304. mblt_vision/models/YOLOv6m-face.yaml +27 -0
  305. mblt_vision/models/YOLOv6n-face.yaml +27 -0
  306. mblt_vision/models/YOLOv7.yaml +44 -0
  307. mblt_vision/models/YOLOv7d6.yaml +50 -0
  308. mblt_vision/models/YOLOv7e6.yaml +50 -0
  309. mblt_vision/models/YOLOv7e6e.yaml +50 -0
  310. mblt_vision/models/YOLOv7w6.yaml +50 -0
  311. mblt_vision/models/YOLOv7x.yaml +44 -0
  312. mblt_vision/models/YOLOv8l-cls.yaml +23 -0
  313. mblt_vision/models/YOLOv8l-face.yaml +27 -0
  314. mblt_vision/models/YOLOv8l-obb.yaml +28 -0
  315. mblt_vision/models/YOLOv8l-pose.yaml +28 -0
  316. mblt_vision/models/YOLOv8l-seg.yaml +28 -0
  317. mblt_vision/models/YOLOv8l.yaml +27 -0
  318. mblt_vision/models/YOLOv8m-cls.yaml +23 -0
  319. mblt_vision/models/YOLOv8m-face.yaml +27 -0
  320. mblt_vision/models/YOLOv8m-obb.yaml +28 -0
  321. mblt_vision/models/YOLOv8m-pose.yaml +28 -0
  322. mblt_vision/models/YOLOv8m-seg.yaml +28 -0
  323. mblt_vision/models/YOLOv8m.yaml +27 -0
  324. mblt_vision/models/YOLOv8n-cls.yaml +23 -0
  325. mblt_vision/models/YOLOv8n-face.yaml +27 -0
  326. mblt_vision/models/YOLOv8n-obb.yaml +28 -0
  327. mblt_vision/models/YOLOv8n-pose.yaml +28 -0
  328. mblt_vision/models/YOLOv8n-seg.yaml +28 -0
  329. mblt_vision/models/YOLOv8n.yaml +27 -0
  330. mblt_vision/models/YOLOv8s-cls.yaml +23 -0
  331. mblt_vision/models/YOLOv8s-obb.yaml +28 -0
  332. mblt_vision/models/YOLOv8s-pose.yaml +28 -0
  333. mblt_vision/models/YOLOv8s-seg.yaml +28 -0
  334. mblt_vision/models/YOLOv8s.yaml +27 -0
  335. mblt_vision/models/YOLOv8x-cls.yaml +23 -0
  336. mblt_vision/models/YOLOv8x-obb.yaml +28 -0
  337. mblt_vision/models/YOLOv8x-pose-p6.yaml +28 -0
  338. mblt_vision/models/YOLOv8x-pose.yaml +28 -0
  339. mblt_vision/models/YOLOv8x-seg.yaml +28 -0
  340. mblt_vision/models/YOLOv8x.yaml +27 -0
  341. mblt_vision/models/YOLOv9c-seg.yaml +28 -0
  342. mblt_vision/models/YOLOv9c.yaml +27 -0
  343. mblt_vision/models/YOLOv9e-seg.yaml +28 -0
  344. mblt_vision/models/YOLOv9e.yaml +27 -0
  345. mblt_vision/models/YOLOv9m.yaml +27 -0
  346. mblt_vision/models/YOLOv9s.yaml +27 -0
  347. mblt_vision/models/YOLOv9t.yaml +27 -0
  348. mblt_vision/obb/__init__.py +39 -0
  349. mblt_vision/object_detection/__init__.py +153 -0
  350. mblt_vision/pose_estimation/__init__.py +41 -0
  351. mblt_vision/py.typed +1 -0
  352. mblt_vision/semantic_segmentation/__init__.py +29 -0
  353. mblt_vision/utils/__init__.py +0 -0
  354. mblt_vision/utils/datasets/__init__.py +85 -0
  355. mblt_vision/utils/datasets/ade20k.py +41 -0
  356. mblt_vision/utils/datasets/cityscapes.py +66 -0
  357. mblt_vision/utils/datasets/coco.py +243 -0
  358. mblt_vision/utils/datasets/dataloader.py +1016 -0
  359. mblt_vision/utils/datasets/dotav1.py +59 -0
  360. mblt_vision/utils/datasets/imagenet.py +29 -0
  361. mblt_vision/utils/datasets/organizer.py +2145 -0
  362. mblt_vision/utils/datasets/readiness.py +1063 -0
  363. mblt_vision/utils/evaluation/__init__.py +51 -0
  364. mblt_vision/utils/evaluation/_result.py +22 -0
  365. mblt_vision/utils/evaluation/eval_ade20k.py +302 -0
  366. mblt_vision/utils/evaluation/eval_cityscapes.py +32 -0
  367. mblt_vision/utils/evaluation/eval_coco.py +465 -0
  368. mblt_vision/utils/evaluation/eval_dota.py +878 -0
  369. mblt_vision/utils/evaluation/eval_imagenet.py +151 -0
  370. mblt_vision/utils/evaluation/eval_nyu_depth.py +189 -0
  371. mblt_vision/utils/evaluation/eval_widerface.py +440 -0
  372. mblt_vision/utils/letterbox.py +118 -0
  373. mblt_vision/utils/postprocess/__init__.py +9 -0
  374. mblt_vision/utils/postprocess/_letterbox.py +102 -0
  375. mblt_vision/utils/postprocess/base.py +743 -0
  376. mblt_vision/utils/postprocess/build_post.py +120 -0
  377. mblt_vision/utils/postprocess/cls_post.py +117 -0
  378. mblt_vision/utils/postprocess/common.py +1571 -0
  379. mblt_vision/utils/postprocess/depth_post.py +106 -0
  380. mblt_vision/utils/postprocess/semantic_seg_post.py +192 -0
  381. mblt_vision/utils/postprocess/yolo_anchor_post.py +469 -0
  382. mblt_vision/utils/postprocess/yolo_anchorless_post.py +952 -0
  383. mblt_vision/utils/postprocess/yolo_dflfree_post.py +983 -0
  384. mblt_vision/utils/postprocess/yolo_nmsfree_post.py +176 -0
  385. mblt_vision/utils/preprocess/__init__.py +27 -0
  386. mblt_vision/utils/preprocess/_validation.py +66 -0
  387. mblt_vision/utils/preprocess/base.py +157 -0
  388. mblt_vision/utils/preprocess/build_pre.py +48 -0
  389. mblt_vision/utils/preprocess/center_crop.py +75 -0
  390. mblt_vision/utils/preprocess/letterbox.py +123 -0
  391. mblt_vision/utils/preprocess/normalize.py +94 -0
  392. mblt_vision/utils/preprocess/order.py +74 -0
  393. mblt_vision/utils/preprocess/reader.py +94 -0
  394. mblt_vision/utils/preprocess/resize.py +202 -0
  395. mblt_vision/utils/preprocess/yolo_pre.py +7 -0
  396. mblt_vision/utils/results.py +725 -0
  397. mblt_vision/utils/types.py +15 -0
  398. mblt_vision/wrapper.py +1121 -0
  399. mblt_vision_python-0.0.0.dist-info/METADATA +152 -0
  400. mblt_vision_python-0.0.0.dist-info/RECORD +404 -0
  401. mblt_vision_python-0.0.0.dist-info/WHEEL +5 -0
  402. mblt_vision_python-0.0.0.dist-info/entry_points.txt +2 -0
  403. mblt_vision_python-0.0.0.dist-info/licenses/LICENSE +28 -0
  404. mblt_vision_python-0.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,51 @@
1
+ """
2
+ Evaluation scripts for various datasets.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from ._result import EvaluationResult
8
+ from .eval_ade20k import (
9
+ ADE20KResult,
10
+ SemanticMetricAccumulator,
11
+ SemanticSegmentationResult,
12
+ calculate_semantic_metrics,
13
+ eval_ade20k,
14
+ eval_semantic_segmentation,
15
+ )
16
+ from .eval_cityscapes import eval_cityscapes
17
+ from .eval_coco import COCOResult, eval_coco, eval_coco_metrics
18
+ from .eval_dota import DOTAResult, eval_dota
19
+ from .eval_imagenet import ImageNetResult, eval_imagenet, eval_imagenet_metrics
20
+ from .eval_nyu_depth import (
21
+ NYUDepthMetricAccumulator,
22
+ NYUDepthResult,
23
+ calculate_nyu_depth_metrics,
24
+ eval_nyu_depth,
25
+ )
26
+ from .eval_widerface import WiderFaceResult, eval_widerface
27
+
28
+ __all__: list[str] = [
29
+ "eval_coco",
30
+ "eval_coco_metrics",
31
+ "COCOResult",
32
+ "EvaluationResult",
33
+ "ADE20KResult",
34
+ "SemanticMetricAccumulator",
35
+ "SemanticSegmentationResult",
36
+ "calculate_semantic_metrics",
37
+ "eval_ade20k",
38
+ "eval_cityscapes",
39
+ "eval_semantic_segmentation",
40
+ "DOTAResult",
41
+ "eval_dota",
42
+ "ImageNetResult",
43
+ "eval_imagenet",
44
+ "eval_imagenet_metrics",
45
+ "NYUDepthResult",
46
+ "NYUDepthMetricAccumulator",
47
+ "calculate_nyu_depth_metrics",
48
+ "eval_nyu_depth",
49
+ "WiderFaceResult",
50
+ "eval_widerface",
51
+ ]
@@ -0,0 +1,22 @@
1
+ """Shared structural contract for Vision evaluator results."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Protocol, runtime_checkable
6
+
7
+
8
+ @runtime_checkable
9
+ class EvaluationResult(Protocol):
10
+ """Result object exposing the primary and secondary benchmark scores."""
11
+
12
+ @property
13
+ def primary_score(self) -> float:
14
+ """Return the evaluator's primary score."""
15
+
16
+ ...
17
+
18
+ @property
19
+ def secondary_score(self) -> float:
20
+ """Return the evaluator's secondary score."""
21
+
22
+ ...
@@ -0,0 +1,302 @@
1
+ """ADE20K evaluation for semantic-segmentation models."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, NamedTuple
6
+
7
+ import numpy as np
8
+ import torch
9
+ from tqdm import tqdm
10
+
11
+ from ..datasets import (
12
+ CustomADE20K,
13
+ CustomCityscapes,
14
+ get_ade20k_loader,
15
+ get_cityscapes_loader,
16
+ )
17
+
18
+ if TYPE_CHECKING:
19
+ from ...wrapper import MBLT_Engine
20
+
21
+
22
+ class SemanticSegmentationResult(NamedTuple):
23
+ """Generic semantic metrics ordered from primary to secondary."""
24
+
25
+ miou: float
26
+ pixel_accuracy: float
27
+
28
+ @property
29
+ def primary_score(self) -> float:
30
+ """Return mean intersection-over-union."""
31
+
32
+ return self.miou
33
+
34
+ @property
35
+ def secondary_score(self) -> float:
36
+ """Return overall valid-pixel accuracy."""
37
+
38
+ return self.pixel_accuracy
39
+
40
+
41
+ ADE20KResult = SemanticSegmentationResult
42
+
43
+
44
+ class SemanticMetricAccumulator:
45
+ """Accumulate an ignore-aware semantic confusion matrix."""
46
+
47
+ def __init__(self, nc: int, ignore_label: int = 255) -> None:
48
+ """Initialize an empty confusion matrix.
49
+
50
+ Args:
51
+ nc: Number of semantic classes.
52
+ ignore_label: Target label excluded from metrics.
53
+ """
54
+
55
+ self.nc = nc
56
+ self.ignore_label = ignore_label
57
+ self.matrix = np.zeros((nc, nc), dtype=np.int64)
58
+
59
+ def update(self, prediction: np.ndarray, target: np.ndarray) -> None:
60
+ """Accumulate one or more predicted and target class maps.
61
+
62
+ Args:
63
+ prediction: Predicted class maps.
64
+ target: Target class maps with optional ignore labels.
65
+
66
+ Raises:
67
+ ValueError: If prediction and target shapes differ.
68
+ """
69
+
70
+ prediction = np.asarray(prediction)
71
+ target = np.asarray(target)
72
+ if prediction.shape != target.shape:
73
+ raise ValueError(
74
+ f"Semantic prediction and target shapes must match, got {prediction.shape} and {target.shape}."
75
+ )
76
+ valid_target = (
77
+ np.isfinite(target)
78
+ & (target >= 0)
79
+ & (target < self.nc)
80
+ & (target == np.floor(target))
81
+ )
82
+ allowed_target = valid_target | (target == self.ignore_label)
83
+ if not bool(allowed_target.all()):
84
+ invalid_values = np.asarray(np.unique(target[~allowed_target]))
85
+ raise ValueError(
86
+ f"Semantic targets must be finite class IDs in [0, {self.nc - 1}] "
87
+ f"or ignore label {self.ignore_label}; got {invalid_values.tolist()}."
88
+ )
89
+ valid_prediction = (
90
+ np.isfinite(prediction)
91
+ & (prediction >= 0)
92
+ & (prediction < self.nc)
93
+ & (prediction == np.floor(prediction))
94
+ )
95
+ invalid_prediction = valid_target & ~valid_prediction
96
+ if invalid_prediction.any():
97
+ invalid_values = np.asarray(np.unique(prediction[invalid_prediction]))
98
+ raise ValueError(
99
+ f"Semantic predictions at valid target pixels must be finite class IDs in [0, {self.nc - 1}], "
100
+ f"got {invalid_values.tolist()}."
101
+ )
102
+ if valid_target.any():
103
+ histogram = np.bincount(
104
+ self.nc * target[valid_target].astype(np.int64)
105
+ + prediction[valid_target].astype(np.int64),
106
+ minlength=self.nc**2,
107
+ )
108
+ self.matrix += histogram.reshape(self.nc, self.nc)
109
+
110
+ def result(self) -> SemanticSegmentationResult:
111
+ """Compute mIoU over present classes and overall pixel accuracy.
112
+
113
+ Returns:
114
+ Pooled semantic-segmentation metrics.
115
+
116
+ Raises:
117
+ ValueError: If no valid target pixels were accumulated.
118
+ """
119
+
120
+ ground_truth = self.matrix.sum(axis=1)
121
+ predicted = self.matrix.sum(axis=0)
122
+ intersection = np.diag(self.matrix)
123
+ union = ground_truth + predicted - intersection
124
+ present = ground_truth > 0
125
+ if not present.any():
126
+ raise ValueError("Semantic evaluation received no valid target pixels.")
127
+ iou = np.divide(
128
+ intersection,
129
+ union,
130
+ out=np.zeros(self.nc, dtype=np.float64),
131
+ where=union > 0,
132
+ )
133
+ total = int(self.matrix.sum())
134
+ return SemanticSegmentationResult(
135
+ miou=float(iou[present].mean()),
136
+ pixel_accuracy=float(intersection.sum() / total),
137
+ )
138
+
139
+
140
+ def calculate_semantic_metrics(
141
+ prediction: np.ndarray,
142
+ target: np.ndarray,
143
+ nc: int = 150,
144
+ ignore_label: int = 255,
145
+ ) -> ADE20KResult:
146
+ """Calculate semantic metrics for one batch of class maps.
147
+
148
+ Args:
149
+ prediction: Predicted class maps.
150
+ target: Target class maps.
151
+ nc: Number of semantic classes.
152
+ ignore_label: Target label excluded from metrics.
153
+
154
+ Returns:
155
+ Semantic metrics exposed through the ADE20K compatibility alias.
156
+
157
+ Raises:
158
+ ValueError: If shapes differ or no valid target pixels are present.
159
+ """
160
+
161
+ accumulator = SemanticMetricAccumulator(nc=nc, ignore_label=ignore_label)
162
+ accumulator.update(prediction, target)
163
+ return accumulator.result()
164
+
165
+
166
+ def _evaluate_semantic_loader(
167
+ model: MBLT_Engine,
168
+ loader: torch.utils.data.DataLoader,
169
+ nc: int,
170
+ description: str = "Evaluating semantic segmentation",
171
+ ) -> SemanticSegmentationResult:
172
+ """Evaluate input-space semantic maps from an organized validation loader.
173
+
174
+ Args:
175
+ model: Initialized semantic-segmentation engine.
176
+ loader: Organized validation data loader.
177
+ nc: Number of semantic classes.
178
+ description: Progress-bar description.
179
+
180
+ Returns:
181
+ Pooled semantic-segmentation metrics.
182
+
183
+ Raises:
184
+ ValueError: If postprocessing returns no class maps or no valid targets exist.
185
+ """
186
+
187
+ accumulator = SemanticMetricAccumulator(nc=nc)
188
+ for inputs, targets, _shapes, _ratio_pads, _ in tqdm(loader, desc=description):
189
+ # TODO: Restore logits to original geometry using shapes and ratio_pads when
190
+ # Ultralytics adopts native-geometry semantic validation metrics.
191
+ result = model.postprocess(model(inputs))
192
+ semantic_mask = result.semantic_mask
193
+ if semantic_mask is None:
194
+ raise ValueError("Semantic postprocessor returned no class maps.")
195
+ prediction = (
196
+ semantic_mask.detach().cpu().numpy()
197
+ if isinstance(semantic_mask, torch.Tensor)
198
+ else semantic_mask
199
+ )
200
+ accumulator.update(np.asarray(prediction), targets)
201
+ return accumulator.result()
202
+
203
+
204
+ def eval_semantic_segmentation(
205
+ model: MBLT_Engine,
206
+ data_path: str,
207
+ batch_size: int,
208
+ dataset: str | None = None,
209
+ ) -> SemanticSegmentationResult:
210
+ """Evaluate a semantic model with the loader for its configured taxonomy.
211
+
212
+ Args:
213
+ model: Initialized semantic-segmentation engine.
214
+ data_path: Organized dataset root.
215
+ batch_size: Number of validation samples per inference batch.
216
+ dataset: Optional taxonomy override. Defaults to ``model.post_cfg.dataset``.
217
+
218
+ Returns:
219
+ Generic mIoU and pixel-accuracy result.
220
+
221
+ Raises:
222
+ ValueError: If preprocessing metadata, image size, taxonomy, predictions, or targets are invalid.
223
+ """
224
+
225
+ configured_dataset = model.post_cfg.get("dataset")
226
+ if not isinstance(configured_dataset, str) or not configured_dataset:
227
+ raise ValueError(
228
+ "Semantic validation requires model.post_cfg.dataset to declare the model taxonomy."
229
+ )
230
+ configured_taxonomy = configured_dataset.lower()
231
+ if dataset is not None:
232
+ if not isinstance(dataset, str) or not dataset:
233
+ raise ValueError(
234
+ "Semantic validation dataset overrides must be non-empty strings."
235
+ )
236
+ requested_taxonomy = dataset.lower()
237
+ if requested_taxonomy != configured_taxonomy:
238
+ raise ValueError(
239
+ f"Requested semantic validation taxonomy {requested_taxonomy!r} conflicts with "
240
+ f"the model's configured taxonomy {configured_taxonomy!r}."
241
+ )
242
+ taxonomy = configured_taxonomy
243
+
244
+ letterbox_cfg = model.pre_cfg.get("LetterBox")
245
+ if not isinstance(letterbox_cfg, dict) or "img_size" not in letterbox_cfg:
246
+ raise ValueError(
247
+ "Semantic validation requires a LetterBox img_size in the model preprocessing config."
248
+ )
249
+ image_size = letterbox_cfg["img_size"]
250
+ if not isinstance(image_size, list) or len(image_size) != 2:
251
+ raise ValueError(
252
+ "Semantic validation img_size must be a two-item [height, width] list."
253
+ )
254
+
255
+ image_size_tuple = (int(image_size[0]), int(image_size[1]))
256
+ if taxonomy == "ade20k":
257
+ validation_dataset = CustomADE20K(data_path)
258
+ loader = get_ade20k_loader(
259
+ validation_dataset,
260
+ batch_size,
261
+ model.preprocess_with_metadata,
262
+ image_size=image_size_tuple,
263
+ )
264
+ default_nc = 150
265
+ description = "Evaluating ADE20K"
266
+ elif taxonomy == "cityscapes":
267
+ validation_dataset = CustomCityscapes(data_path)
268
+ loader = get_cityscapes_loader(
269
+ validation_dataset,
270
+ batch_size,
271
+ model.preprocess_with_metadata,
272
+ image_size=image_size_tuple,
273
+ )
274
+ default_nc = 19
275
+ description = "Evaluating Cityscapes"
276
+ else:
277
+ raise ValueError(f"Unsupported semantic validation dataset: {taxonomy!r}.")
278
+ nc = int(getattr(model.postprocessor, "nc", default_nc))
279
+ return _evaluate_semantic_loader(model, loader, nc, description=description)
280
+
281
+
282
+ def eval_ade20k(model: MBLT_Engine, data_path: str, batch_size: int) -> ADE20KResult:
283
+ """Evaluate a semantic-segmentation model on ADE20K validation masks.
284
+
285
+ Args:
286
+ model: Initialized semantic-segmentation engine.
287
+ data_path: Organized ADE20K dataset root.
288
+ batch_size: Number of validation samples per inference batch.
289
+
290
+ Returns:
291
+ ADE20K metrics through the generic semantic result type.
292
+
293
+ Raises:
294
+ ValueError: If the dataset, preprocessing metadata, predictions, or targets are invalid.
295
+ """
296
+
297
+ return eval_semantic_segmentation(
298
+ model,
299
+ data_path,
300
+ batch_size,
301
+ dataset="ade20k",
302
+ )
@@ -0,0 +1,32 @@
1
+ """Cityscapes evaluation for semantic-segmentation models."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ from .eval_ade20k import SemanticSegmentationResult, eval_semantic_segmentation
8
+
9
+ if TYPE_CHECKING:
10
+ from ...wrapper import MBLT_Engine
11
+
12
+
13
+ def eval_cityscapes(
14
+ model: MBLT_Engine, data_path: str, batch_size: int
15
+ ) -> SemanticSegmentationResult:
16
+ """Evaluate a semantic-segmentation model on Cityscapes validation masks.
17
+
18
+ Args:
19
+ model: Initialized semantic-segmentation engine.
20
+ data_path: Organized Cityscapes dataset root.
21
+ batch_size: Number of validation samples per inference batch.
22
+
23
+ Returns:
24
+ Cityscapes mIoU and pixel-accuracy metrics.
25
+
26
+ Raises:
27
+ ValueError: If the dataset, preprocessing metadata, predictions, or targets are invalid.
28
+ """
29
+
30
+ return eval_semantic_segmentation(
31
+ model, data_path, batch_size, dataset="cityscapes"
32
+ )