@camera.ui/server 0.0.50-internal.0 → 0.0.50-internal.2

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 (390) hide show
  1. package/dist/interface/index.html +44 -44
  2. package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.BAIU_p3r.0.0.50-internal.2.js} +1 -1
  3. package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.mdCorqzE.0.0.50-internal.2.js} +1 -1
  4. package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.D0vsSsly.0.0.50-internal.2.js} +1 -1
  5. package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.we5ZpWr2.0.0.50-internal.2.js} +1 -1
  6. package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.9AEBJ3H1.0.0.50-internal.2.js} +1 -1
  7. package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.CZcnEH0C.0.0.50-internal.2.js} +1 -1
  8. package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.DE0LkcGu.0.0.50-internal.2.js} +2 -2
  9. package/dist/interface/js/Cammesh.CVvmkelB.0.0.50-internal.2.js +1 -0
  10. package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.CUr4pGoU.0.0.50-internal.2.js} +1 -1
  11. package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.CaJhu4fF.0.0.50-internal.2.js} +2 -2
  12. package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.5VUmgryj.0.0.50-internal.2.js} +1 -1
  13. package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.iYmUxAR5.0.0.50-internal.2.js} +1 -1
  14. package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.DXPyE5mF.0.0.50-internal.2.js} +1 -1
  15. package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.BqtlOFnV.0.0.50-internal.2.js} +1 -1
  16. package/dist/interface/js/{FirstSteps.b-nvymgb.0.0.50-internal.0.js → FirstSteps.C_RI-SDQ.0.0.50-internal.2.js} +1 -1
  17. package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.Ch_v02eN.0.0.50-internal.2.js} +1 -1
  18. package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.BpXAYgSG.0.0.50-internal.2.js} +1 -1
  19. package/dist/interface/js/Recordings.CIKHJytH.0.0.50-internal.2.js +1 -0
  20. package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.BcLoGNEy.0.0.50-internal.2.js} +1 -1
  21. package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.DMROW8kx.0.0.50-internal.2.js} +1 -1
  22. package/dist/interface/js/SettingsAppearance.CUaHpihp.0.0.50-internal.2.js +1 -0
  23. package/dist/interface/js/{SettingsAppearance.vue_vue_type_script_setup_true_lang.CBQ6lL3T.0.0.50-internal.0.js → SettingsAppearance.vue_vue_type_script_setup_true_lang.BuKZ-Uco.0.0.50-internal.2.js} +1 -1
  24. package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.0QdwFSpv.0.0.50-internal.2.js} +1 -1
  25. package/dist/interface/js/SettingsRecordings.B-aj0U8_.0.0.50-internal.2.js +1 -0
  26. package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.Bi1YAJ76.0.0.50-internal.2.js} +1 -1
  27. package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.CAx66Iir.0.0.50-internal.2.js} +1 -1
  28. package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.CQcDtGy1.0.0.50-internal.2.js} +1 -1
  29. package/dist/interface/js/{VersionsHandler.vue_vue_type_script_setup_true_lang.xDishkkS.0.0.50-internal.0.js → VersionsHandler.vue_vue_type_script_setup_true_lang.BhXMzIhV.0.0.50-internal.2.js} +1 -1
  30. package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0sCXSu5.0.0.50-internal.2.js} +2 -2
  31. package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.DNqPWa0Q.0.0.50-internal.2.js} +1 -1
  32. package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.DAXgG3bP.0.0.50-internal.2.js} +1 -1
  33. package/dist/interface/js/{chart.js.CP_nMnnf.0.0.50-internal.0.js → chart.js.Bq3YocRX.0.0.50-internal.2.js} +1 -1
  34. package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.9rxyNw0z.0.0.50-internal.2.js} +1 -1
  35. package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.BuEvHAsS.0.0.50-internal.2.js} +1 -1
  36. package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.DUdE08x8.0.0.50-internal.2.js} +1 -1
  37. package/dist/interface/js/{engine.io-client.kITRnq-g.0.0.50-internal.0.js → engine.io-client.DWU6YI8o.0.0.50-internal.2.js} +1 -1
  38. package/dist/interface/js/{fast-deep-equal.Bpc9mIsj.0.0.50-internal.0.js → fast-deep-equal.BpPyC6E4.0.0.50-internal.2.js} +1 -1
  39. package/dist/interface/js/{highlight.js.BlSXU-Wb.0.0.50-internal.0.js → highlight.js.BoR2Rhdd.0.0.50-internal.2.js} +1 -1
  40. package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BXzPONHs.0.0.50-internal.2.js} +1 -1
  41. package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.DwcBYfWc.0.0.50-internal.2.js} +3 -3
  42. package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.BUDVOjPt.0.0.50-internal.2.js} +1 -1
  43. package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CsG-OBoI.0.0.50-internal.2.js} +1 -1
  44. package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CqEQao5R.0.0.50-internal.2.js} +1 -1
  45. package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.D91sslRx.0.0.50-internal.2.js} +1 -1
  46. package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.SdSTPzZO.0.0.50-internal.2.js} +1 -1
  47. package/dist/interface/js/{react-dnd-touch-backend.BA4WhUJo.0.0.50-internal.0.js → react-dnd-touch-backend.BwroebQ4.0.0.50-internal.2.js} +1 -1
  48. package/dist/interface/js/{refresh-rounded.D_SmhhUf.0.0.50-internal.0.js → refresh-rounded.DxM48YSv.0.0.50-internal.2.js} +1 -1
  49. package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.Cmpbnzo4.0.0.50-internal.2.js} +1 -1
  50. package/dist/interface/js/{socket.io-client.DKrRxgjP.0.0.50-internal.0.js → socket.io-client.DF2YgZo1.0.0.50-internal.2.js} +1 -1
  51. package/dist/interface/js/{socket.io-parser.EXj3YDH2.0.0.50-internal.0.js → socket.io-parser.BUs2ineY.0.0.50-internal.2.js} +1 -1
  52. package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.DmkT2LKx.0.0.50-internal.2.js} +1 -1
  53. package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.dPzyZDVa.0.0.50-internal.2.js} +1 -1
  54. package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.y2ZlFveS.0.0.50-internal.2.js} +1 -1
  55. package/dist/interface/js/{vee-validate.BeiObIH8.0.0.50-internal.0.js → vee-validate.Y-alCADW.0.0.50-internal.2.js} +1 -1
  56. package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.sRVFTqDf.0.0.50-internal.2.js} +1 -1
  57. package/dist/interface/js/{vue-i18n.BW2bx_6z.0.0.50-internal.0.js → vue-i18n.D5WrXOZa.0.0.50-internal.2.js} +1 -1
  58. package/dist/interface/js/{vue-inline-svg.BJkQGmKz.0.0.50-internal.0.js → vue-inline-svg.R0uz_abA.0.0.50-internal.2.js} +1 -1
  59. package/dist/interface/js/{vue-router.B2mOXHaC.0.0.50-internal.0.js → vue-router.65mnGy-o.0.0.50-internal.2.js} +1 -1
  60. package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.B1Qop6Uu.0.0.50-internal.2.js} +1 -1
  61. package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.CwmyAcir.0.0.50-internal.2.js} +1 -1
  62. package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.CMPALvRh.0.0.50-internal.2.js} +1 -1
  63. package/dist/interface/sw.js +1 -1
  64. package/dist/server/package.json +1 -1
  65. package/dist/server/src/rpc/server.js +4 -1
  66. package/dist/server/src/rpc/server.js.map +1 -1
  67. package/package.json +1 -1
  68. package/.prettierignore +0 -12
  69. package/.prettierrc.json +0 -12
  70. package/artillery.yaml +0 -29
  71. package/bin/cameraui-server.ts +0 -11
  72. package/dist/interface/js/Cammesh.D-6dAROQ.0.0.50-internal.0.js +0 -1
  73. package/dist/interface/js/Recordings.DhxjIW7e.0.0.50-internal.0.js +0 -1
  74. package/dist/interface/js/SettingsAppearance.DsTjKXk1.0.0.50-internal.0.js +0 -1
  75. package/dist/interface/js/SettingsRecordings.DgW7M0jj.0.0.50-internal.0.js +0 -1
  76. package/eslint.config.js +0 -103
  77. package/localdeps.txt +0 -10
  78. package/mypy.ini +0 -30
  79. package/requirements.txt +0 -15
  80. package/ruff.toml +0 -90
  81. package/src/__init__.py +0 -0
  82. package/src/_camera_ui_tools/__init__.py +0 -0
  83. package/src/_camera_ui_tools/__pycache__/__init__.cpython-311.pyc +0 -0
  84. package/src/api/controllers/api.controller.ts +0 -19
  85. package/src/api/controllers/auth.controller.ts +0 -294
  86. package/src/api/controllers/backup.controller.ts +0 -72
  87. package/src/api/controllers/cameras.controller.ts +0 -1029
  88. package/src/api/controllers/config.controller.ts +0 -102
  89. package/src/api/controllers/files.controller.ts +0 -35
  90. package/src/api/controllers/frameWorkers.controller.ts +0 -109
  91. package/src/api/controllers/plugins.controller.ts +0 -1206
  92. package/src/api/controllers/system.controller.ts +0 -273
  93. package/src/api/controllers/users.controller.ts +0 -648
  94. package/src/api/database/checks.ts +0 -268
  95. package/src/api/database/constants.ts +0 -8
  96. package/src/api/database/index.ts +0 -262
  97. package/src/api/database/migration.ts +0 -62
  98. package/src/api/database/selfcheck.ts +0 -492
  99. package/src/api/database/types.ts +0 -104
  100. package/src/api/go2rtc/api/application.ts +0 -48
  101. package/src/api/go2rtc/api/config.ts +0 -61
  102. package/src/api/go2rtc/api/discover.ts +0 -197
  103. package/src/api/go2rtc/api/index.ts +0 -49
  104. package/src/api/go2rtc/api/snapshot.ts +0 -44
  105. package/src/api/go2rtc/api/streams.ts +0 -168
  106. package/src/api/go2rtc/index.ts +0 -43
  107. package/src/api/go2rtc/queue.ts +0 -50
  108. package/src/api/go2rtc/types.ts +0 -174
  109. package/src/api/index.ts +0 -286
  110. package/src/api/middlewares/authPermission.middleware.ts +0 -46
  111. package/src/api/middlewares/authValidation.middleware.ts +0 -160
  112. package/src/api/middlewares/pagination.middleware.ts +0 -67
  113. package/src/api/middlewares/socketAuth.middleware.ts +0 -136
  114. package/src/api/plugins/header.plugin.ts +0 -15
  115. package/src/api/plugins/logger.plugin.ts +0 -44
  116. package/src/api/plugins/proxy.plugin.ts +0 -255
  117. package/src/api/plugins/socket.plugin.ts +0 -28
  118. package/src/api/plugins/system.plugin.ts +0 -48
  119. package/src/api/plugins/useragent.plugin.ts +0 -19
  120. package/src/api/routes/api.routes.ts +0 -10
  121. package/src/api/routes/auth.routes.ts +0 -56
  122. package/src/api/routes/backup.routes.ts +0 -28
  123. package/src/api/routes/cameras.routes.ts +0 -281
  124. package/src/api/routes/config.routes.ts +0 -66
  125. package/src/api/routes/files.routes.ts +0 -15
  126. package/src/api/routes/frameWorkers.routes.ts +0 -39
  127. package/src/api/routes/index.ts +0 -37
  128. package/src/api/routes/plugins.routes.ts +0 -420
  129. package/src/api/routes/system.routes.ts +0 -101
  130. package/src/api/routes/users.routes.ts +0 -167
  131. package/src/api/schemas/backup.schema.ts +0 -112
  132. package/src/api/schemas/cameras.schema.ts +0 -479
  133. package/src/api/schemas/config.schema.ts +0 -38
  134. package/src/api/schemas/go2rtc.schema.ts +0 -189
  135. package/src/api/schemas/plugins.schema.ts +0 -126
  136. package/src/api/schemas/storage.schema.ts +0 -11
  137. package/src/api/schemas/system.schema.ts +0 -45
  138. package/src/api/schemas/users.schema.ts +0 -185
  139. package/src/api/services/auth.service.ts +0 -210
  140. package/src/api/services/backup.service.ts +0 -144
  141. package/src/api/services/cameras.service.ts +0 -671
  142. package/src/api/services/plugins.service.ts +0 -470
  143. package/src/api/services/system.service.ts +0 -85
  144. package/src/api/services/users.service.ts +0 -276
  145. package/src/api/types/index.ts +0 -675
  146. package/src/api/utils/cert.ts +0 -254
  147. package/src/api/utils/constants.ts +0 -17
  148. package/src/api/utils/fetch.ts +0 -21
  149. package/src/api/utils/moveFiles.ts +0 -45
  150. package/src/api/utils/parse.ts +0 -17
  151. package/src/api/websocket/index.ts +0 -110
  152. package/src/api/websocket/nsp/logs.ts +0 -240
  153. package/src/api/websocket/nsp/main.ts +0 -27
  154. package/src/api/websocket/nsp/metrics.ts +0 -301
  155. package/src/api/websocket/nsp/notifications.ts +0 -43
  156. package/src/api/websocket/nsp/plugins.ts +0 -37
  157. package/src/api/websocket/nsp/server.ts +0 -220
  158. package/src/api/websocket/nsp/status.ts +0 -77
  159. package/src/api/websocket/types.ts +0 -55
  160. package/src/api.ts +0 -163
  161. package/src/camera/classes.ts +0 -32
  162. package/src/camera/controller.ts +0 -579
  163. package/src/camera/device.ts +0 -422
  164. package/src/camera/frameWorker.ts +0 -403
  165. package/src/camera/index.ts +0 -679
  166. package/src/camera/interfaces.ts +0 -95
  167. package/src/camera/iou.ts +0 -153
  168. package/src/camera/polygon.ts +0 -226
  169. package/src/camera/python/__init__.py +0 -0
  170. package/src/camera/python/__pycache__/__init__.cpython-311.pyc +0 -0
  171. package/src/camera/python/__pycache__/classes.cpython-311.pyc +0 -0
  172. package/src/camera/python/__pycache__/delegate_controller.cpython-311.pyc +0 -0
  173. package/src/camera/python/__pycache__/interfaces.cpython-311.pyc +0 -0
  174. package/src/camera/python/__pycache__/iou.cpython-310.pyc +0 -0
  175. package/src/camera/python/__pycache__/iou.cpython-311.pyc +0 -0
  176. package/src/camera/python/__pycache__/iou2.cpython-310.pyc +0 -0
  177. package/src/camera/python/__pycache__/polygon.cpython-311.pyc +0 -0
  178. package/src/camera/python/__pycache__/typings.cpython-311.pyc +0 -0
  179. package/src/camera/python/__pycache__/video_frame.cpython-311.pyc +0 -0
  180. package/src/camera/python/classes.py +0 -41
  181. package/src/camera/python/interfaces.py +0 -130
  182. package/src/camera/python/iou.py +0 -158
  183. package/src/camera/python/polygon.py +0 -230
  184. package/src/camera/python/test/__pycache__/polygon.cpython-310.pyc +0 -0
  185. package/src/camera/python/test/iou_test.py +0 -799
  186. package/src/camera/python/test/polygon.py +0 -238
  187. package/src/camera/python/test/polygon_test.py +0 -256
  188. package/src/camera/python/test/polygon_test2.py +0 -484
  189. package/src/camera/python/typings.py +0 -50
  190. package/src/camera/python/video_frame.py +0 -143
  191. package/src/camera/session.ts +0 -192
  192. package/src/camera/streaming/fmp4-session.ts +0 -390
  193. package/src/camera/streaming/peer-connection.ts +0 -273
  194. package/src/camera/streaming/rtsp-session.ts +0 -331
  195. package/src/camera/streaming/webrtc-connection.ts +0 -260
  196. package/src/camera/streaming/werift-session.ts +0 -317
  197. package/src/camera/test/iou_test.ts +0 -761
  198. package/src/camera/test/polygon.test.ts +0 -611
  199. package/src/camera/test/polygon_test.ts +0 -210
  200. package/src/camera/types.ts +0 -48
  201. package/src/camera/utils.ts +0 -489
  202. package/src/camera/videoFrame.ts +0 -123
  203. package/src/cloud/index.ts +0 -61
  204. package/src/cloud/remote/cloudflare.ts +0 -18
  205. package/src/cloud/remote/upnp.ts +0 -18
  206. package/src/cloud/remote/utils.ts +0 -24
  207. package/src/cloud/types.ts +0 -16
  208. package/src/decoder/child.ts +0 -883
  209. package/src/decoder/imageUtils.ts +0 -275
  210. package/src/decoder/manager.ts +0 -251
  211. package/src/decoder/python/__init__.py +0 -0
  212. package/src/decoder/python/__pycache__/__init__.cpython-311.pyc +0 -0
  213. package/src/decoder/python/__pycache__/image_utils.cpython-311.pyc +0 -0
  214. package/src/decoder/python/__pycache__/typings.cpython-311.pyc +0 -0
  215. package/src/decoder/python/__pycache__/utils.cpython-311.pyc +0 -0
  216. package/src/decoder/python/child.py +0 -903
  217. package/src/decoder/python/image_utils.py +0 -196
  218. package/src/decoder/python/pool.py +0 -45
  219. package/src/decoder/python/test/group.py +0 -62
  220. package/src/decoder/python/test/motion.mp4 +0 -0
  221. package/src/decoder/python/test/motion2.mp4 +0 -0
  222. package/src/decoder/python/test/opencl.cl +0 -70
  223. package/src/decoder/python/test/opencl2.cl +0 -130
  224. package/src/decoder/python/test/test.py +0 -427
  225. package/src/decoder/python/test/test1.jpg +0 -0
  226. package/src/decoder/python/test/test1_resized.jpg +0 -0
  227. package/src/decoder/python/test/test2.jpg +0 -0
  228. package/src/decoder/python/test/test2.py +0 -451
  229. package/src/decoder/python/test/test2_resized.jpg +0 -0
  230. package/src/decoder/python/test/test3.jpg +0 -0
  231. package/src/decoder/python/test/utils.py +0 -50
  232. package/src/decoder/python/typings.py +0 -57
  233. package/src/decoder/python/utils.py +0 -70
  234. package/src/decoder/test/child.ts +0 -117
  235. package/src/decoder/test/ffmpeg.ts +0 -371
  236. package/src/decoder/test/test.ts +0 -182
  237. package/src/decoder/types.ts +0 -27
  238. package/src/decoder/utils.ts +0 -64
  239. package/src/decoder/wasm/asconfig.json +0 -28
  240. package/src/decoder/wasm/assembly/console.ts +0 -1
  241. package/src/decoder/wasm/assembly/index.ts +0 -890
  242. package/src/decoder/wasm/build/decoder.d.ts +0 -43
  243. package/src/decoder/wasm/build/decoder.js +0 -108
  244. package/src/decoder/wasm/build/decoder.wasm +0 -0
  245. package/src/decoder/wasm/tsconfig.json +0 -5
  246. package/src/decoder/worker.ts +0 -113
  247. package/src/go2rtc/index.ts +0 -324
  248. package/src/go2rtc/types.ts +0 -88
  249. package/src/main.ts +0 -267
  250. package/src/manager/coreManager.ts +0 -78
  251. package/src/manager/deviceManager.ts +0 -132
  252. package/src/manager/types.ts +0 -17
  253. package/src/plugins/index.ts +0 -443
  254. package/src/plugins/plugin.ts +0 -177
  255. package/src/plugins/runtime/base.ts +0 -282
  256. package/src/plugins/runtime/index.ts +0 -15
  257. package/src/plugins/runtime/node/child.ts +0 -193
  258. package/src/plugins/runtime/node/index.ts +0 -67
  259. package/src/plugins/runtime/node/plugin.ts +0 -122
  260. package/src/plugins/runtime/node/pluginApi.ts +0 -27
  261. package/src/plugins/runtime/node/proxy/cameraDevice.ts +0 -299
  262. package/src/plugins/runtime/node/proxy/coreManager.ts +0 -128
  263. package/src/plugins/runtime/node/proxy/deviceManager.ts +0 -187
  264. package/src/plugins/runtime/node/storage.ts +0 -312
  265. package/src/plugins/runtime/node/storageController.ts +0 -91
  266. package/src/plugins/runtime/python/__init__.py +0 -0
  267. package/src/plugins/runtime/python/__pycache__/__init__.cpython-311.pyc +0 -0
  268. package/src/plugins/runtime/python/__pycache__/camera_storage.cpython-311.pyc +0 -0
  269. package/src/plugins/runtime/python/__pycache__/config_service.cpython-311.pyc +0 -0
  270. package/src/plugins/runtime/python/__pycache__/constants.cpython-311.pyc +0 -0
  271. package/src/plugins/runtime/python/__pycache__/ipc.cpython-311.pyc +0 -0
  272. package/src/plugins/runtime/python/__pycache__/logger.cpython-311.pyc +0 -0
  273. package/src/plugins/runtime/python/__pycache__/message_queue.cpython-311.pyc +0 -0
  274. package/src/plugins/runtime/python/__pycache__/namespaces.cpython-311.pyc +0 -0
  275. package/src/plugins/runtime/python/__pycache__/plugin.cpython-311.pyc +0 -0
  276. package/src/plugins/runtime/python/__pycache__/plugin_api.cpython-311.pyc +0 -0
  277. package/src/plugins/runtime/python/__pycache__/plugin_logger.cpython-311.pyc +0 -0
  278. package/src/plugins/runtime/python/__pycache__/proxy_utils.cpython-311.pyc +0 -0
  279. package/src/plugins/runtime/python/__pycache__/schema.cpython-311.pyc +0 -0
  280. package/src/plugins/runtime/python/__pycache__/storage.cpython-311.pyc +0 -0
  281. package/src/plugins/runtime/python/__pycache__/storage_controller.cpython-311.pyc +0 -0
  282. package/src/plugins/runtime/python/__pycache__/typings.cpython-311.pyc +0 -0
  283. package/src/plugins/runtime/python/child.py +0 -248
  284. package/src/plugins/runtime/python/index.ts +0 -73
  285. package/src/plugins/runtime/python/namespaces.py +0 -101
  286. package/src/plugins/runtime/python/plugin.py +0 -155
  287. package/src/plugins/runtime/python/plugin_api.py +0 -29
  288. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-310.pyc +0 -0
  289. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-311.pyc +0 -0
  290. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-38.pyc +0 -0
  291. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-39.pyc +0 -0
  292. package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-311.pyc +0 -0
  293. package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-39.pyc +0 -0
  294. package/src/plugins/runtime/python/proxy/__pycache__/core_manager.cpython-311.pyc +0 -0
  295. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-310.pyc +0 -0
  296. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-311.pyc +0 -0
  297. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-38.pyc +0 -0
  298. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-39.pyc +0 -0
  299. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-310.pyc +0 -0
  300. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-311.pyc +0 -0
  301. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-38.pyc +0 -0
  302. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-39.pyc +0 -0
  303. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-310.pyc +0 -0
  304. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-311.pyc +0 -0
  305. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-38.pyc +0 -0
  306. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-39.pyc +0 -0
  307. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-310.pyc +0 -0
  308. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-311.pyc +0 -0
  309. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-38.pyc +0 -0
  310. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-39.pyc +0 -0
  311. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-310.pyc +0 -0
  312. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-311.pyc +0 -0
  313. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-38.pyc +0 -0
  314. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-39.pyc +0 -0
  315. package/src/plugins/runtime/python/proxy/camera_device.py +0 -1732
  316. package/src/plugins/runtime/python/proxy/core_manager.py +0 -126
  317. package/src/plugins/runtime/python/proxy/device_manager.py +0 -197
  318. package/src/plugins/runtime/python/schema.py +0 -99
  319. package/src/plugins/runtime/python/storage.py +0 -353
  320. package/src/plugins/runtime/python/storage_controller.py +0 -102
  321. package/src/plugins/runtime/python/typings.py +0 -195
  322. package/src/plugins/schema.ts +0 -472
  323. package/src/plugins/types.ts +0 -60
  324. package/src/plugins/worker.ts +0 -250
  325. package/src/rpc/index.ts +0 -149
  326. package/src/rpc/namespaces.ts +0 -79
  327. package/src/rpc/server.ts +0 -422
  328. package/src/rpc/types.ts +0 -119
  329. package/src/rpc/utils.ts +0 -16
  330. package/src/services/config/constants.ts +0 -47
  331. package/src/services/config/defaults.ts +0 -57
  332. package/src/services/config/index.ts +0 -744
  333. package/src/services/config/types.ts +0 -211
  334. package/src/services/logger/index.ts +0 -96
  335. package/src/types.ts +0 -47
  336. package/src/utils/path.ts +0 -16
  337. package/src/utils/pythonInstaller.ts +0 -597
  338. package/tsconfig.json +0 -37
  339. package/types/fastify.d.ts +0 -14
  340. package/updates.config.js +0 -3
  341. /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.50-internal.0.css → @xterm.DYP7pi_n.0.0.50-internal.2.css} +0 -0
  342. /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.2.css} +0 -0
  343. /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.2.css} +0 -0
  344. /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.2.css} +0 -0
  345. /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.2.css} +0 -0
  346. /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.2.css} +0 -0
  347. /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.2.css} +0 -0
  348. /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.2.css} +0 -0
  349. /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.2.css} +0 -0
  350. /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.2.css} +0 -0
  351. /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.2.css} +0 -0
  352. /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.2.css} +0 -0
  353. /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.2.css} +0 -0
  354. /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.2.png} +0 -0
  355. /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.2.png} +0 -0
  356. /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.2.png} +0 -0
  357. /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.2.css} +0 -0
  358. /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.2.js} +0 -0
  359. /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.2.js} +0 -0
  360. /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.2.js} +0 -0
  361. /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.2.js} +0 -0
  362. /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.2.js} +0 -0
  363. /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  364. /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.2.js} +0 -0
  365. /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.2.js} +0 -0
  366. /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.2.js} +0 -0
  367. /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.2.js} +0 -0
  368. /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.2.js} +0 -0
  369. /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.2.js} +0 -0
  370. /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.C-5Lxnx_.0.0.50-internal.2.js} +0 -0
  371. /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.2.js} +0 -0
  372. /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  373. /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.2.js} +0 -0
  374. /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.2.js} +0 -0
  375. /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.50-internal.0.js → engine.io-parser.BiEtp6m2.0.0.50-internal.2.js} +0 -0
  376. /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.2.js} +0 -0
  377. /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.50-internal.0.js → ev-emitter.X5f1qa-c.0.0.50-internal.2.js} +0 -0
  378. /package/dist/interface/js/{get-size.D1dS-IaP.0.0.50-internal.0.js → get-size.D1dS-IaP.0.0.50-internal.2.js} +0 -0
  379. /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  380. /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.2.js} +0 -0
  381. /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  382. /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.2.js} +0 -0
  383. /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.2.js} +0 -0
  384. /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.0.js → react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.2.js} +0 -0
  385. /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.2.js} +0 -0
  386. /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.2.js} +0 -0
  387. /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.2.js} +0 -0
  388. /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.2.js} +0 -0
  389. /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  390. /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.2.js} +0 -0
@@ -1,799 +0,0 @@
1
- import time
2
- from typing import Any, TypedDict, cast
3
-
4
- from typing_extensions import NotRequired
5
-
6
- from ..iou import merge_detections
7
-
8
- BoundingBox = tuple[float, float, float, float]
9
-
10
-
11
- class Detection(TypedDict):
12
- id: NotRequired[str]
13
- label: str
14
- confidence: float
15
- boundingBox: BoundingBox
16
- inputWidth: int
17
- inputHeight: int
18
- origWidth: int
19
- origHeight: int
20
-
21
-
22
- def create_detection(
23
- id: str,
24
- label: str,
25
- confidence: float,
26
- bounding_box: BoundingBox,
27
- input_width: int,
28
- input_height: int,
29
- ) -> Detection:
30
- return {
31
- "id": id,
32
- "label": cast(Any, label),
33
- "confidence": confidence,
34
- "boundingBox": bounding_box,
35
- "inputWidth": input_width,
36
- "inputHeight": input_height,
37
- "origWidth": input_width,
38
- "origHeight": input_height,
39
- }
40
-
41
-
42
- class TestDetection(TypedDict):
43
- name: str
44
- detections: list[Detection]
45
-
46
-
47
- # Fixed values for "Many small boxes" test
48
- many_small_boxes_data = [
49
- (100, 100, 200, 200, 0.9),
50
- (150, 150, 250, 250, 0.85),
51
- (175, 175, 275, 275, 0.8),
52
- (300, 300, 400, 400, 0.95),
53
- (350, 350, 450, 450, 0.87),
54
- (500, 100, 600, 200, 0.92),
55
- (550, 150, 650, 250, 0.88),
56
- (700, 700, 800, 800, 0.91),
57
- (750, 750, 850, 850, 0.86),
58
- (200, 500, 300, 600, 0.93),
59
- ]
60
-
61
- cameraUiDetections: list[Detection] = [
62
- {
63
- "label": "motion",
64
- "confidence": 1,
65
- "boundingBox": (490, 201, 505, 231),
66
- "inputWidth": 640,
67
- "inputHeight": 360,
68
- "origWidth": 2304,
69
- "origHeight": 1296,
70
- },
71
- {
72
- "label": "motion",
73
- "confidence": 1,
74
- "boundingBox": (522, 196, 542, 218),
75
- "inputWidth": 640,
76
- "inputHeight": 360,
77
- "origWidth": 2304,
78
- "origHeight": 1296,
79
- },
80
- {
81
- "label": "motion",
82
- "confidence": 1,
83
- "boundingBox": (140, 193, 159, 232),
84
- "inputWidth": 640,
85
- "inputHeight": 360,
86
- "origWidth": 2304,
87
- "origHeight": 1296,
88
- },
89
- {
90
- "label": "motion",
91
- "confidence": 1,
92
- "boundingBox": (540, 183, 556, 206),
93
- "inputWidth": 640,
94
- "inputHeight": 360,
95
- "origWidth": 2304,
96
- "origHeight": 1296,
97
- },
98
- {
99
- "label": "motion",
100
- "confidence": 1,
101
- "boundingBox": (504, 181, 525, 200),
102
- "inputWidth": 640,
103
- "inputHeight": 360,
104
- "origWidth": 2304,
105
- "origHeight": 1296,
106
- },
107
- ]
108
-
109
- cameraUiDetections2: list[Detection] = [
110
- {
111
- "label": "motion",
112
- "confidence": 1,
113
- "boundingBox": (351, 333, 372, 360),
114
- "inputWidth": 640,
115
- "inputHeight": 360,
116
- "origWidth": 2304,
117
- "origHeight": 1296,
118
- },
119
- {
120
- "label": "motion",
121
- "confidence": 1,
122
- "boundingBox": (382, 279, 398, 314),
123
- "inputWidth": 640,
124
- "inputHeight": 360,
125
- "origWidth": 2304,
126
- "origHeight": 1296,
127
- },
128
- {
129
- "label": "motion",
130
- "confidence": 1,
131
- "boundingBox": (399, 276, 433, 360),
132
- "inputWidth": 640,
133
- "inputHeight": 360,
134
- "origWidth": 2304,
135
- "origHeight": 1296,
136
- },
137
- {
138
- "label": "motion",
139
- "confidence": 1,
140
- "boundingBox": (411, 95, 461, 275),
141
- "inputWidth": 640,
142
- "inputHeight": 360,
143
- "origWidth": 2304,
144
- "origHeight": 1296,
145
- },
146
- {
147
- "label": "motion",
148
- "confidence": 1,
149
- "boundingBox": (401, 90, 419, 120),
150
- "inputWidth": 640,
151
- "inputHeight": 360,
152
- "origWidth": 2304,
153
- "origHeight": 1296,
154
- },
155
- {
156
- "label": "motion",
157
- "confidence": 1,
158
- "boundingBox": (271, 73, 414, 324),
159
- "inputWidth": 640,
160
- "inputHeight": 360,
161
- "origWidth": 2304,
162
- "origHeight": 1296,
163
- },
164
- {
165
- "label": "motion",
166
- "confidence": 1,
167
- "boundingBox": (232, 5, 260, 25),
168
- "inputWidth": 640,
169
- "inputHeight": 360,
170
- "origWidth": 2304,
171
- "origHeight": 1296,
172
- },
173
- ]
174
-
175
- cameraUiDetections3: list[Detection] = [
176
- {
177
- "label": "motion",
178
- "confidence": 1,
179
- "boundingBox": (319, 212, 354, 316),
180
- "inputWidth": 640,
181
- "inputHeight": 360,
182
- "origWidth": 2304,
183
- "origHeight": 1296,
184
- },
185
- {
186
- "label": "motion",
187
- "confidence": 1,
188
- "boundingBox": (361, 176, 396, 267),
189
- "inputWidth": 640,
190
- "inputHeight": 360,
191
- "origWidth": 2304,
192
- "origHeight": 1296,
193
- },
194
- {
195
- "label": "motion",
196
- "confidence": 1,
197
- "boundingBox": (324, 164, 367, 199),
198
- "inputWidth": 640,
199
- "inputHeight": 360,
200
- "origWidth": 2304,
201
- "origHeight": 1296,
202
- },
203
- {
204
- "label": "motion",
205
- "confidence": 1,
206
- "boundingBox": (338, 102, 358, 124),
207
- "inputWidth": 640,
208
- "inputHeight": 360,
209
- "origWidth": 2304,
210
- "origHeight": 1296,
211
- },
212
- {
213
- "label": "motion",
214
- "confidence": 1,
215
- "boundingBox": (287, 76, 405, 316),
216
- "inputWidth": 640,
217
- "inputHeight": 360,
218
- "origWidth": 2304,
219
- "origHeight": 1296,
220
- },
221
- ]
222
-
223
- cameraUiDetections4: list[Detection] = [
224
- {
225
- "label": "motion",
226
- "confidence": 1,
227
- "boundingBox": (402, 347, 436, 360),
228
- "inputWidth": 640,
229
- "inputHeight": 360,
230
- "origWidth": 2304,
231
- "origHeight": 1296,
232
- },
233
- {
234
- "label": "motion",
235
- "confidence": 1,
236
- "boundingBox": (49, 342, 81, 360),
237
- "inputWidth": 640,
238
- "inputHeight": 360,
239
- "origWidth": 2304,
240
- "origHeight": 1296,
241
- },
242
- {
243
- "label": "motion",
244
- "confidence": 1,
245
- "boundingBox": (126, 332, 148, 360),
246
- "inputWidth": 640,
247
- "inputHeight": 360,
248
- "origWidth": 2304,
249
- "origHeight": 1296,
250
- },
251
- {
252
- "label": "motion",
253
- "confidence": 1,
254
- "boundingBox": (348, 329, 386, 360),
255
- "inputWidth": 640,
256
- "inputHeight": 360,
257
- "origWidth": 2304,
258
- "origHeight": 1296,
259
- },
260
- {
261
- "label": "motion",
262
- "confidence": 1,
263
- "boundingBox": (409, 328, 436, 348),
264
- "inputWidth": 640,
265
- "inputHeight": 360,
266
- "origWidth": 2304,
267
- "origHeight": 1296,
268
- },
269
- {
270
- "label": "motion",
271
- "confidence": 1,
272
- "boundingBox": (317, 302, 334, 326),
273
- "inputWidth": 640,
274
- "inputHeight": 360,
275
- "origWidth": 2304,
276
- "origHeight": 1296,
277
- },
278
- {
279
- "label": "motion",
280
- "confidence": 1,
281
- "boundingBox": (347, 297, 358, 331),
282
- "inputWidth": 640,
283
- "inputHeight": 360,
284
- "origWidth": 2304,
285
- "origHeight": 1296,
286
- },
287
- {
288
- "label": "motion",
289
- "confidence": 1,
290
- "boundingBox": (201, 294, 222, 311),
291
- "inputWidth": 640,
292
- "inputHeight": 360,
293
- "origWidth": 2304,
294
- "origHeight": 1296,
295
- },
296
- {
297
- "label": "motion",
298
- "confidence": 1,
299
- "boundingBox": (275, 278, 299, 360),
300
- "inputWidth": 640,
301
- "inputHeight": 360,
302
- "origWidth": 2304,
303
- "origHeight": 1296,
304
- },
305
- {
306
- "label": "motion",
307
- "confidence": 1,
308
- "boundingBox": (312, 274, 333, 306),
309
- "inputWidth": 640,
310
- "inputHeight": 360,
311
- "origWidth": 2304,
312
- "origHeight": 1296,
313
- },
314
- {
315
- "label": "motion",
316
- "confidence": 1,
317
- "boundingBox": (565, 268, 595, 299),
318
- "inputWidth": 640,
319
- "inputHeight": 360,
320
- "origWidth": 2304,
321
- "origHeight": 1296,
322
- },
323
- {
324
- "label": "motion",
325
- "confidence": 1,
326
- "boundingBox": (200, 267, 218, 289),
327
- "inputWidth": 640,
328
- "inputHeight": 360,
329
- "origWidth": 2304,
330
- "origHeight": 1296,
331
- },
332
- {
333
- "label": "motion",
334
- "confidence": 1,
335
- "boundingBox": (123, 232, 197, 316),
336
- "inputWidth": 640,
337
- "inputHeight": 360,
338
- "origWidth": 2304,
339
- "origHeight": 1296,
340
- },
341
- {
342
- "label": "motion",
343
- "confidence": 1,
344
- "boundingBox": (297, 230, 327, 242),
345
- "inputWidth": 640,
346
- "inputHeight": 360,
347
- "origWidth": 2304,
348
- "origHeight": 1296,
349
- },
350
- {
351
- "label": "motion",
352
- "confidence": 1,
353
- "boundingBox": (7, 217, 155, 343),
354
- "inputWidth": 640,
355
- "inputHeight": 360,
356
- "origWidth": 2304,
357
- "origHeight": 1296,
358
- },
359
- {
360
- "label": "motion",
361
- "confidence": 1,
362
- "boundingBox": (250, 110, 345, 243),
363
- "inputWidth": 640,
364
- "inputHeight": 360,
365
- "origWidth": 2304,
366
- "origHeight": 1296,
367
- },
368
- {
369
- "label": "motion",
370
- "confidence": 1,
371
- "boundingBox": (345, 70, 406, 326),
372
- "inputWidth": 640,
373
- "inputHeight": 360,
374
- "origWidth": 2304,
375
- "origHeight": 1296,
376
- },
377
- {
378
- "label": "motion",
379
- "confidence": 1,
380
- "boundingBox": (376, 59, 396, 90),
381
- "inputWidth": 640,
382
- "inputHeight": 360,
383
- "origWidth": 2304,
384
- "origHeight": 1296,
385
- },
386
- {
387
- "label": "motion",
388
- "confidence": 1,
389
- "boundingBox": (297, 58, 341, 124),
390
- "inputWidth": 640,
391
- "inputHeight": 360,
392
- "origWidth": 2304,
393
- "origHeight": 1296,
394
- },
395
- {
396
- "label": "motion",
397
- "confidence": 1,
398
- "boundingBox": (550, 39, 606, 73),
399
- "inputWidth": 640,
400
- "inputHeight": 360,
401
- "origWidth": 2304,
402
- "origHeight": 1296,
403
- },
404
- {
405
- "label": "motion",
406
- "confidence": 1,
407
- "boundingBox": (192, 27, 235, 80),
408
- "inputWidth": 640,
409
- "inputHeight": 360,
410
- "origWidth": 2304,
411
- "origHeight": 1296,
412
- },
413
- ]
414
-
415
- cameraUiDetections5: list[Detection] = [
416
- {
417
- "label": "motion",
418
- "confidence": 1,
419
- "boundingBox": (52, 324, 82, 360),
420
- "inputWidth": 640,
421
- "inputHeight": 360,
422
- "origWidth": 2304,
423
- "origHeight": 1296,
424
- },
425
- {
426
- "label": "motion",
427
- "confidence": 1,
428
- "boundingBox": (399, 307, 449, 360),
429
- "inputWidth": 640,
430
- "inputHeight": 360,
431
- "origWidth": 2304,
432
- "origHeight": 1296,
433
- },
434
- {
435
- "label": "motion",
436
- "confidence": 1,
437
- "boundingBox": (530, 294, 560, 311),
438
- "inputWidth": 640,
439
- "inputHeight": 360,
440
- "origWidth": 2304,
441
- "origHeight": 1296,
442
- },
443
- {
444
- "label": "motion",
445
- "confidence": 1,
446
- "boundingBox": (156, 290, 227, 360),
447
- "inputWidth": 640,
448
- "inputHeight": 360,
449
- "origWidth": 2304,
450
- "origHeight": 1296,
451
- },
452
- {
453
- "label": "motion",
454
- "confidence": 1,
455
- "boundingBox": (314, 279, 334, 320),
456
- "inputWidth": 640,
457
- "inputHeight": 360,
458
- "origWidth": 2304,
459
- "origHeight": 1296,
460
- },
461
- {
462
- "label": "motion",
463
- "confidence": 1,
464
- "boundingBox": (554, 219, 624, 300),
465
- "inputWidth": 640,
466
- "inputHeight": 360,
467
- "origWidth": 2304,
468
- "origHeight": 1296,
469
- },
470
- {
471
- "label": "motion",
472
- "confidence": 1,
473
- "boundingBox": (0, 218, 227, 360),
474
- "inputWidth": 640,
475
- "inputHeight": 360,
476
- "origWidth": 2304,
477
- "origHeight": 1296,
478
- },
479
- {
480
- "label": "motion",
481
- "confidence": 1,
482
- "boundingBox": (204, 166, 297, 346),
483
- "inputWidth": 640,
484
- "inputHeight": 360,
485
- "origWidth": 2304,
486
- "origHeight": 1296,
487
- },
488
- {
489
- "label": "motion",
490
- "confidence": 1,
491
- "boundingBox": (254, 106, 302, 189),
492
- "inputWidth": 640,
493
- "inputHeight": 360,
494
- "origWidth": 2304,
495
- "origHeight": 1296,
496
- },
497
- {
498
- "label": "motion",
499
- "confidence": 1,
500
- "boundingBox": (260, 76, 285, 121),
501
- "inputWidth": 640,
502
- "inputHeight": 360,
503
- "origWidth": 2304,
504
- "origHeight": 1296,
505
- },
506
- {
507
- "label": "motion",
508
- "confidence": 1,
509
- "boundingBox": (296, 74, 409, 360),
510
- "inputWidth": 640,
511
- "inputHeight": 360,
512
- "origWidth": 2304,
513
- "origHeight": 1296,
514
- },
515
- {
516
- "label": "motion",
517
- "confidence": 1,
518
- "boundingBox": (302, 45, 365, 112),
519
- "inputWidth": 640,
520
- "inputHeight": 360,
521
- "origWidth": 2304,
522
- "origHeight": 1296,
523
- },
524
- {
525
- "label": "motion",
526
- "confidence": 1,
527
- "boundingBox": (0, 43, 22, 71),
528
- "inputWidth": 640,
529
- "inputHeight": 360,
530
- "origWidth": 2304,
531
- "origHeight": 1296,
532
- },
533
- {
534
- "label": "motion",
535
- "confidence": 1,
536
- "boundingBox": (631, 41, 640, 83),
537
- "inputWidth": 640,
538
- "inputHeight": 360,
539
- "origWidth": 2304,
540
- "origHeight": 1296,
541
- },
542
- {
543
- "label": "motion",
544
- "confidence": 1,
545
- "boundingBox": (549, 37, 627, 75),
546
- "inputWidth": 640,
547
- "inputHeight": 360,
548
- "origWidth": 2304,
549
- "origHeight": 1296,
550
- },
551
- {
552
- "label": "motion",
553
- "confidence": 1,
554
- "boundingBox": (439, 34, 478, 52),
555
- "inputWidth": 640,
556
- "inputHeight": 360,
557
- "origWidth": 2304,
558
- "origHeight": 1296,
559
- },
560
- {
561
- "label": "motion",
562
- "confidence": 1,
563
- "boundingBox": (507, 33, 548, 55),
564
- "inputWidth": 640,
565
- "inputHeight": 360,
566
- "origWidth": 2304,
567
- "origHeight": 1296,
568
- },
569
- {
570
- "label": "motion",
571
- "confidence": 1,
572
- "boundingBox": (374, 28, 418, 101),
573
- "inputWidth": 640,
574
- "inputHeight": 360,
575
- "origWidth": 2304,
576
- "origHeight": 1296,
577
- },
578
- {
579
- "label": "motion",
580
- "confidence": 1,
581
- "boundingBox": (190, 23, 239, 84),
582
- "inputWidth": 640,
583
- "inputHeight": 360,
584
- "origWidth": 2304,
585
- "origHeight": 1296,
586
- },
587
- ]
588
-
589
- cameraUiDetections6: list[Detection] = [
590
- {
591
- "id": "9e732521-9f9e-4840-a09b-b621981751fd",
592
- "label": "person",
593
- "confidence": 0.6787109375,
594
- "boundingBox": (466.5625, 195.0, 639.0625, 639.375),
595
- "inputWidth": 640,
596
- "inputHeight": 640,
597
- "origWidth": 2304,
598
- "origHeight": 1296,
599
- },
600
- {
601
- "id": "9644b70e-126e-4e17-9cdb-ef16f851a96e",
602
- "label": "toothbrush",
603
- "confidence": 0.5546875,
604
- "boundingBox": (169.140625, 281.875, 271.484375, 515.0),
605
- "inputWidth": 640,
606
- "inputHeight": 640,
607
- "origWidth": 2304,
608
- "origHeight": 1296,
609
- },
610
- {
611
- "id": "23e1aff7-c7f1-47f5-bc5d-affe8a852af7",
612
- "label": "bottle",
613
- "confidence": 0.4921875,
614
- "boundingBox": (241.7529296875, 581.30859375, 254.4970703125, 624.31640625),
615
- "inputWidth": 640,
616
- "inputHeight": 640,
617
- "origWidth": 2304,
618
- "origHeight": 1296,
619
- },
620
- {
621
- "id": "814448bb-14d8-4928-95c3-7b3427f971c4",
622
- "label": "bottle",
623
- "confidence": 0.3056640625,
624
- "boundingBox": (77.578125, 521.328125, 140.703125, 639.296875),
625
- "inputWidth": 640,
626
- "inputHeight": 640,
627
- "origWidth": 2304,
628
- "origHeight": 1296,
629
- },
630
- ]
631
-
632
- extendedMixedLabelsTest: TestDetection = {
633
- "name": "Extended Mixed Labels",
634
- "detections": [
635
- create_detection("1", "person", 0.9, (100, 100, 200, 200), 640, 360),
636
- create_detection("2", "person", 0.85, (150, 150, 250, 250), 640, 360),
637
- create_detection("3", "car", 0.8, (300, 300, 400, 400), 640, 360),
638
- create_detection("4", "car", 0.75, (350, 350, 450, 450), 640, 360),
639
- create_detection("5", "bicycle", 0.7, (500, 500, 550, 550), 640, 360),
640
- create_detection("6", "motorcycle", 0.65, (520, 520, 570, 570), 640, 360),
641
- create_detection("7", "", 0.6, (600, 600, 650, 650), 640, 360),
642
- create_detection("8", "person", 0.95, (180, 180, 280, 280), 640, 360),
643
- ],
644
- }
645
-
646
- touchingBoxesTest: TestDetection = {
647
- "name": "Touching Boxes",
648
- "detections": [
649
- create_detection("1", "motion", 0.9, (0, 0, 100, 100), 640, 360),
650
- create_detection("2", "motion", 0.8, (100, 0, 200, 100), 640, 360),
651
- create_detection("3", "motion", 0.7, (0, 100, 100, 200), 640, 360),
652
- create_detection("4", "motion", 0.6, (100, 100, 200, 200), 640, 360),
653
- create_detection("5", "motion", 0.5, (200, 0, 300, 300), 640, 360),
654
- ],
655
- }
656
-
657
- test_cases: list[TestDetection] = [
658
- {
659
- "name": "Original test case",
660
- "detections": [
661
- create_detection("1", "motion", 0.9, (0, 0, 1000, 1000), 1000, 1000),
662
- create_detection("2", "motion", 0.8, (100, 100, 300, 300), 1000, 1000),
663
- create_detection("3", "motion", 0.7, (400, 400, 600, 600), 1000, 1000),
664
- create_detection("4", "motion", 0.6, (700, 700, 900, 900), 1000, 1000),
665
- create_detection("5", "motion", 0.75, (800, 800, 1100, 1100), 1000, 1000),
666
- ],
667
- },
668
- {
669
- "name": "Multiple overlapping boxes",
670
- "detections": [
671
- create_detection("1", "motion", 0.9, (0, 0, 500, 500), 1000, 1000),
672
- create_detection("2", "motion", 0.8, (250, 250, 750, 750), 1000, 1000),
673
- create_detection("3", "motion", 0.7, (500, 500, 1000, 1000), 1000, 1000),
674
- ],
675
- },
676
- {
677
- "name": "Boxes around the edges",
678
- "detections": [
679
- create_detection("1", "motion", 0.9, (400, 400, 600, 600), 1000, 1000),
680
- create_detection("2", "motion", 0.8, (0, 0, 200, 200), 1000, 1000),
681
- create_detection("3", "motion", 0.7, (800, 0, 1000, 200), 1000, 1000),
682
- create_detection("4", "motion", 0.6, (0, 800, 200, 1000), 1000, 1000),
683
- create_detection("5", "motion", 0.5, (800, 800, 1000, 1000), 1000, 1000),
684
- ],
685
- },
686
- {
687
- "name": "Nested boxes",
688
- "detections": [
689
- create_detection("1", "motion", 0.9, (0, 0, 1000, 1000), 1000, 1000),
690
- create_detection("2", "motion", 0.8, (200, 200, 800, 800), 1000, 1000),
691
- create_detection("3", "motion", 0.7, (400, 400, 600, 600), 1000, 1000),
692
- ],
693
- },
694
- {
695
- "name": "Many small boxes",
696
- "detections": [
697
- create_detection(
698
- str(i + 1),
699
- "motion",
700
- confidence,
701
- (x1, y1, x2, y2),
702
- 1000,
703
- 1000,
704
- )
705
- for i, (x1, y1, x2, y2, confidence) in enumerate(many_small_boxes_data)
706
- ],
707
- },
708
- {
709
- "name": "Mixed Labels",
710
- "detections": [
711
- create_detection("1", "person", 0.9, (100, 100, 200, 200), 640, 360),
712
- create_detection("2", "car", 0.8, (150, 150, 250, 250), 640, 360),
713
- create_detection("3", "vehicle", 0.85, (180, 180, 280, 280), 640, 360),
714
- ],
715
- },
716
- extendedMixedLabelsTest,
717
- touchingBoxesTest,
718
- {
719
- "name": "camera.ui 1",
720
- "detections": cameraUiDetections,
721
- },
722
- {
723
- "name": "camera.ui 2",
724
- "detections": cameraUiDetections2,
725
- },
726
- {
727
- "name": "camera.ui 3",
728
- "detections": cameraUiDetections3,
729
- },
730
- {
731
- "name": "camera.ui 4",
732
- "detections": cameraUiDetections4,
733
- },
734
- {
735
- "name": "camera.ui 5",
736
- "detections": cameraUiDetections5,
737
- },
738
- {
739
- "name": "camera.ui 6",
740
- "detections": cameraUiDetections6,
741
- },
742
- ]
743
-
744
-
745
- def calculate_avg_box_size(detections: list[Detection]) -> float:
746
- total_size = sum(
747
- (d["boundingBox"][2] - d["boundingBox"][0]) * (d["boundingBox"][3] - d["boundingBox"][1])
748
- for d in detections
749
- )
750
- return total_size / len(detections) if detections else 0
751
-
752
-
753
- def run_tests(iou_threshold: float = 0.01, close_threshold: float = 160):
754
- for test_case in test_cases:
755
- print(f"\nRunning test case: {test_case['name']}")
756
- print(f"Original Detections: {len(test_case['detections'])}")
757
-
758
- start_time = time.time()
759
- merged_detections = merge_detections(test_case["detections"], iou_threshold, close_threshold)
760
- end_time = time.time()
761
-
762
- print(f"Merged Detections: {len(merged_detections)}")
763
- print(f"Execution time: {((end_time - start_time) * 1000):.3f} ms")
764
-
765
- # Basic validation
766
- if len(merged_detections) <= len(test_case["detections"]):
767
- print("✅ Test passed: Number of merged detections is not greater than original")
768
- else:
769
- print("❌ Test failed: Number of merged detections is greater than original")
770
-
771
- # Check if bounding boxes are valid
772
- invalid_boxes = [
773
- d
774
- for d in merged_detections
775
- if d["boundingBox"][0] > d["boundingBox"][2] or d["boundingBox"][1] > d["boundingBox"][3]
776
- ]
777
- if not invalid_boxes:
778
- print("✅ Test passed: All merged bounding boxes are valid")
779
- else:
780
- print("❌ Test failed: Some merged bounding boxes are invalid")
781
-
782
- # Calculate average bounding box size change
783
- original_avg_size = calculate_avg_box_size(test_case["detections"])
784
- merged_avg_size = calculate_avg_box_size(cast(list[Detection], merged_detections))
785
- size_change_percent = (
786
- ((merged_avg_size - original_avg_size) / original_avg_size * 100) if original_avg_size else 0
787
- )
788
- print(f"Average bounding box size change: {size_change_percent:.2f}%")
789
-
790
- # Print bounding boxes for visual inspection
791
- print("Merged Bounding Boxes:")
792
- for i, d in enumerate(merged_detections, 1):
793
- print(f" {d['label']}: Box {i}: [{', '.join(map(str, d['boundingBox']))}]")
794
-
795
- print("\n" + "=" * 50)
796
-
797
-
798
- if __name__ == "__main__":
799
- run_tests()