@camera.ui/server 0.0.50-internal.0 → 0.0.50-internal.1
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.
- package/dist/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.CiB2EGly.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.DxMw_rJn.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.RxZ3hn6V.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.C-k73ACm.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.DumNu6GD.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.BuosoqFl.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.A7NJflGG.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/Cammesh.Dv3C0UiR.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.GgjJp7JR.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.BL3L-BFE.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.CxwRmUVF.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.D16kkT6R.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.Bkp__d8n.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.C9HKvo0G.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{FirstSteps.b-nvymgb.0.0.50-internal.0.js → FirstSteps.QuJjtAtF.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.BLUUbEej.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.DviCIk7w.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/Recordings.Dsp07cHs.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.Clx4y9gP.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.cfY4-PYd.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/SettingsAppearance.CBGZAazb.0.0.50-internal.1.js +1 -0
- 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.kxAPXcBy.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.DOaJA4pp.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/SettingsRecordings.BGcwL6tk.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.BVU_w1Jm.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.P0vy90vA.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.DaP5m7eo.0.0.50-internal.1.js} +1 -1
- 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.MmrWYW3K.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0aqA_3x.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.C9wgzklI.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.BeH6lJ5t.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{chart.js.CP_nMnnf.0.0.50-internal.0.js → chart.js.BQHSWV_g.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.DDKMxauw.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.dWz9rJqH.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.D-iZIS1n.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{engine.io-client.kITRnq-g.0.0.50-internal.0.js → engine.io-client.BwxOddB_.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{fast-deep-equal.Bpc9mIsj.0.0.50-internal.0.js → fast-deep-equal.Dz96RC_N.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{highlight.js.BlSXU-Wb.0.0.50-internal.0.js → highlight.js.CmcM8OM6.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BgLcBzlw.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.6bOgRV7D.0.0.50-internal.1.js} +3 -3
- package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.CTgfs-3p.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CMhnq8jS.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CuC5ZfNs.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.DmwjJ4xV.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.DGZO3j1c.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{react-dnd-touch-backend.BA4WhUJo.0.0.50-internal.0.js → react-dnd-touch-backend.CEGHlD-T.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{refresh-rounded.D_SmhhUf.0.0.50-internal.0.js → refresh-rounded.D0keXzBc.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.CiDbFOB0.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{socket.io-client.DKrRxgjP.0.0.50-internal.0.js → socket.io-client.BPcXPAHG.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{socket.io-parser.EXj3YDH2.0.0.50-internal.0.js → socket.io-parser.DSGzrW_l.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.BKlEObmx.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.BDFILs86.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.DcxsxHCS.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vee-validate.BeiObIH8.0.0.50-internal.0.js → vee-validate.BGRg3oQ8.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.B9yk2de7.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-i18n.BW2bx_6z.0.0.50-internal.0.js → vue-i18n.DXDZITpf.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-inline-svg.BJkQGmKz.0.0.50-internal.0.js → vue-inline-svg.BDYaTfbi.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-router.B2mOXHaC.0.0.50-internal.0.js → vue-router.CFEDA008.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.zqTafMgD.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.BxM3dbYs.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.B6SY9IIj.0.0.50-internal.1.js} +1 -1
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +1 -1
- package/package.json +1 -1
- package/.prettierignore +0 -12
- package/.prettierrc.json +0 -12
- package/artillery.yaml +0 -29
- package/bin/cameraui-server.ts +0 -11
- package/dist/interface/js/Cammesh.D-6dAROQ.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/Recordings.DhxjIW7e.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsAppearance.DsTjKXk1.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsRecordings.DgW7M0jj.0.0.50-internal.0.js +0 -1
- package/eslint.config.js +0 -103
- package/localdeps.txt +0 -10
- package/mypy.ini +0 -30
- package/requirements.txt +0 -15
- package/ruff.toml +0 -90
- package/src/__init__.py +0 -0
- package/src/_camera_ui_tools/__init__.py +0 -0
- package/src/_camera_ui_tools/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/api/controllers/api.controller.ts +0 -19
- package/src/api/controllers/auth.controller.ts +0 -294
- package/src/api/controllers/backup.controller.ts +0 -72
- package/src/api/controllers/cameras.controller.ts +0 -1029
- package/src/api/controllers/config.controller.ts +0 -102
- package/src/api/controllers/files.controller.ts +0 -35
- package/src/api/controllers/frameWorkers.controller.ts +0 -109
- package/src/api/controllers/plugins.controller.ts +0 -1206
- package/src/api/controllers/system.controller.ts +0 -273
- package/src/api/controllers/users.controller.ts +0 -648
- package/src/api/database/checks.ts +0 -268
- package/src/api/database/constants.ts +0 -8
- package/src/api/database/index.ts +0 -262
- package/src/api/database/migration.ts +0 -62
- package/src/api/database/selfcheck.ts +0 -492
- package/src/api/database/types.ts +0 -104
- package/src/api/go2rtc/api/application.ts +0 -48
- package/src/api/go2rtc/api/config.ts +0 -61
- package/src/api/go2rtc/api/discover.ts +0 -197
- package/src/api/go2rtc/api/index.ts +0 -49
- package/src/api/go2rtc/api/snapshot.ts +0 -44
- package/src/api/go2rtc/api/streams.ts +0 -168
- package/src/api/go2rtc/index.ts +0 -43
- package/src/api/go2rtc/queue.ts +0 -50
- package/src/api/go2rtc/types.ts +0 -174
- package/src/api/index.ts +0 -286
- package/src/api/middlewares/authPermission.middleware.ts +0 -46
- package/src/api/middlewares/authValidation.middleware.ts +0 -160
- package/src/api/middlewares/pagination.middleware.ts +0 -67
- package/src/api/middlewares/socketAuth.middleware.ts +0 -136
- package/src/api/plugins/header.plugin.ts +0 -15
- package/src/api/plugins/logger.plugin.ts +0 -44
- package/src/api/plugins/proxy.plugin.ts +0 -255
- package/src/api/plugins/socket.plugin.ts +0 -28
- package/src/api/plugins/system.plugin.ts +0 -48
- package/src/api/plugins/useragent.plugin.ts +0 -19
- package/src/api/routes/api.routes.ts +0 -10
- package/src/api/routes/auth.routes.ts +0 -56
- package/src/api/routes/backup.routes.ts +0 -28
- package/src/api/routes/cameras.routes.ts +0 -281
- package/src/api/routes/config.routes.ts +0 -66
- package/src/api/routes/files.routes.ts +0 -15
- package/src/api/routes/frameWorkers.routes.ts +0 -39
- package/src/api/routes/index.ts +0 -37
- package/src/api/routes/plugins.routes.ts +0 -420
- package/src/api/routes/system.routes.ts +0 -101
- package/src/api/routes/users.routes.ts +0 -167
- package/src/api/schemas/backup.schema.ts +0 -112
- package/src/api/schemas/cameras.schema.ts +0 -479
- package/src/api/schemas/config.schema.ts +0 -38
- package/src/api/schemas/go2rtc.schema.ts +0 -189
- package/src/api/schemas/plugins.schema.ts +0 -126
- package/src/api/schemas/storage.schema.ts +0 -11
- package/src/api/schemas/system.schema.ts +0 -45
- package/src/api/schemas/users.schema.ts +0 -185
- package/src/api/services/auth.service.ts +0 -210
- package/src/api/services/backup.service.ts +0 -144
- package/src/api/services/cameras.service.ts +0 -671
- package/src/api/services/plugins.service.ts +0 -470
- package/src/api/services/system.service.ts +0 -85
- package/src/api/services/users.service.ts +0 -276
- package/src/api/types/index.ts +0 -675
- package/src/api/utils/cert.ts +0 -254
- package/src/api/utils/constants.ts +0 -17
- package/src/api/utils/fetch.ts +0 -21
- package/src/api/utils/moveFiles.ts +0 -45
- package/src/api/utils/parse.ts +0 -17
- package/src/api/websocket/index.ts +0 -110
- package/src/api/websocket/nsp/logs.ts +0 -240
- package/src/api/websocket/nsp/main.ts +0 -27
- package/src/api/websocket/nsp/metrics.ts +0 -301
- package/src/api/websocket/nsp/notifications.ts +0 -43
- package/src/api/websocket/nsp/plugins.ts +0 -37
- package/src/api/websocket/nsp/server.ts +0 -220
- package/src/api/websocket/nsp/status.ts +0 -77
- package/src/api/websocket/types.ts +0 -55
- package/src/api.ts +0 -163
- package/src/camera/classes.ts +0 -32
- package/src/camera/controller.ts +0 -579
- package/src/camera/device.ts +0 -422
- package/src/camera/frameWorker.ts +0 -403
- package/src/camera/index.ts +0 -679
- package/src/camera/interfaces.ts +0 -95
- package/src/camera/iou.ts +0 -153
- package/src/camera/polygon.ts +0 -226
- package/src/camera/python/__init__.py +0 -0
- package/src/camera/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/classes.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/delegate_controller.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/interfaces.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou2.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/polygon.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/video_frame.cpython-311.pyc +0 -0
- package/src/camera/python/classes.py +0 -41
- package/src/camera/python/interfaces.py +0 -130
- package/src/camera/python/iou.py +0 -158
- package/src/camera/python/polygon.py +0 -230
- package/src/camera/python/test/__pycache__/polygon.cpython-310.pyc +0 -0
- package/src/camera/python/test/iou_test.py +0 -799
- package/src/camera/python/test/polygon.py +0 -238
- package/src/camera/python/test/polygon_test.py +0 -256
- package/src/camera/python/test/polygon_test2.py +0 -484
- package/src/camera/python/typings.py +0 -50
- package/src/camera/python/video_frame.py +0 -143
- package/src/camera/session.ts +0 -192
- package/src/camera/streaming/fmp4-session.ts +0 -390
- package/src/camera/streaming/peer-connection.ts +0 -273
- package/src/camera/streaming/rtsp-session.ts +0 -331
- package/src/camera/streaming/webrtc-connection.ts +0 -260
- package/src/camera/streaming/werift-session.ts +0 -317
- package/src/camera/test/iou_test.ts +0 -761
- package/src/camera/test/polygon.test.ts +0 -611
- package/src/camera/test/polygon_test.ts +0 -210
- package/src/camera/types.ts +0 -48
- package/src/camera/utils.ts +0 -489
- package/src/camera/videoFrame.ts +0 -123
- package/src/cloud/index.ts +0 -61
- package/src/cloud/remote/cloudflare.ts +0 -18
- package/src/cloud/remote/upnp.ts +0 -18
- package/src/cloud/remote/utils.ts +0 -24
- package/src/cloud/types.ts +0 -16
- package/src/decoder/child.ts +0 -883
- package/src/decoder/imageUtils.ts +0 -275
- package/src/decoder/manager.ts +0 -251
- package/src/decoder/python/__init__.py +0 -0
- package/src/decoder/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/image_utils.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/utils.cpython-311.pyc +0 -0
- package/src/decoder/python/child.py +0 -903
- package/src/decoder/python/image_utils.py +0 -196
- package/src/decoder/python/pool.py +0 -45
- package/src/decoder/python/test/group.py +0 -62
- package/src/decoder/python/test/motion.mp4 +0 -0
- package/src/decoder/python/test/motion2.mp4 +0 -0
- package/src/decoder/python/test/opencl.cl +0 -70
- package/src/decoder/python/test/opencl2.cl +0 -130
- package/src/decoder/python/test/test.py +0 -427
- package/src/decoder/python/test/test1.jpg +0 -0
- package/src/decoder/python/test/test1_resized.jpg +0 -0
- package/src/decoder/python/test/test2.jpg +0 -0
- package/src/decoder/python/test/test2.py +0 -451
- package/src/decoder/python/test/test2_resized.jpg +0 -0
- package/src/decoder/python/test/test3.jpg +0 -0
- package/src/decoder/python/test/utils.py +0 -50
- package/src/decoder/python/typings.py +0 -57
- package/src/decoder/python/utils.py +0 -70
- package/src/decoder/test/child.ts +0 -117
- package/src/decoder/test/ffmpeg.ts +0 -371
- package/src/decoder/test/test.ts +0 -182
- package/src/decoder/types.ts +0 -27
- package/src/decoder/utils.ts +0 -64
- package/src/decoder/wasm/asconfig.json +0 -28
- package/src/decoder/wasm/assembly/console.ts +0 -1
- package/src/decoder/wasm/assembly/index.ts +0 -890
- package/src/decoder/wasm/build/decoder.d.ts +0 -43
- package/src/decoder/wasm/build/decoder.js +0 -108
- package/src/decoder/wasm/build/decoder.wasm +0 -0
- package/src/decoder/wasm/tsconfig.json +0 -5
- package/src/decoder/worker.ts +0 -113
- package/src/go2rtc/index.ts +0 -324
- package/src/go2rtc/types.ts +0 -88
- package/src/main.ts +0 -267
- package/src/manager/coreManager.ts +0 -78
- package/src/manager/deviceManager.ts +0 -132
- package/src/manager/types.ts +0 -17
- package/src/plugins/index.ts +0 -443
- package/src/plugins/plugin.ts +0 -177
- package/src/plugins/runtime/base.ts +0 -282
- package/src/plugins/runtime/index.ts +0 -15
- package/src/plugins/runtime/node/child.ts +0 -193
- package/src/plugins/runtime/node/index.ts +0 -67
- package/src/plugins/runtime/node/plugin.ts +0 -122
- package/src/plugins/runtime/node/pluginApi.ts +0 -27
- package/src/plugins/runtime/node/proxy/cameraDevice.ts +0 -299
- package/src/plugins/runtime/node/proxy/coreManager.ts +0 -128
- package/src/plugins/runtime/node/proxy/deviceManager.ts +0 -187
- package/src/plugins/runtime/node/storage.ts +0 -312
- package/src/plugins/runtime/node/storageController.ts +0 -91
- package/src/plugins/runtime/python/__init__.py +0 -0
- package/src/plugins/runtime/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/camera_storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/config_service.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/ipc.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/namespaces.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_api.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/proxy_utils.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/schema.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage_controller.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/child.py +0 -248
- package/src/plugins/runtime/python/index.ts +0 -73
- package/src/plugins/runtime/python/namespaces.py +0 -101
- package/src/plugins/runtime/python/plugin.py +0 -155
- package/src/plugins/runtime/python/plugin_api.py +0 -29
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/core_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/camera_device.py +0 -1732
- package/src/plugins/runtime/python/proxy/core_manager.py +0 -126
- package/src/plugins/runtime/python/proxy/device_manager.py +0 -197
- package/src/plugins/runtime/python/schema.py +0 -99
- package/src/plugins/runtime/python/storage.py +0 -353
- package/src/plugins/runtime/python/storage_controller.py +0 -102
- package/src/plugins/runtime/python/typings.py +0 -195
- package/src/plugins/schema.ts +0 -472
- package/src/plugins/types.ts +0 -60
- package/src/plugins/worker.ts +0 -250
- package/src/rpc/index.ts +0 -149
- package/src/rpc/namespaces.ts +0 -79
- package/src/rpc/server.ts +0 -422
- package/src/rpc/types.ts +0 -119
- package/src/rpc/utils.ts +0 -16
- package/src/services/config/constants.ts +0 -47
- package/src/services/config/defaults.ts +0 -57
- package/src/services/config/index.ts +0 -744
- package/src/services/config/types.ts +0 -211
- package/src/services/logger/index.ts +0 -96
- package/src/types.ts +0 -47
- package/src/utils/path.ts +0 -16
- package/src/utils/pythonInstaller.ts +0 -597
- package/tsconfig.json +0 -37
- package/updates.config.js +0 -3
- /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.50-internal.0.css → @xterm.DYP7pi_n.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.DIUBesyz.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.50-internal.0.js → engine.io-parser.BiEtp6m2.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.50-internal.0.js → ev-emitter.X5f1qa-c.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{get-size.D1dS-IaP.0.0.50-internal.0.js → get-size.D1dS-IaP.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.0.js → react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.1.js} +0 -0
|
@@ -1,611 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
-
// Ersetze dies durch deine tatsächlichen Importe
|
|
3
|
-
// import { areDetectionsValid } from './your-module';
|
|
4
|
-
|
|
5
|
-
// Type definitions
|
|
6
|
-
type ObjectClass = 'person' | 'vehicle' | 'animal' | 'motion' | 'other';
|
|
7
|
-
type ZoneType = 'intersect' | 'contain';
|
|
8
|
-
type ZoneFilter = 'include' | 'exclude';
|
|
9
|
-
type BoundingBox = [number, number, number, number];
|
|
10
|
-
type Point = [number, number];
|
|
11
|
-
|
|
12
|
-
interface Detection {
|
|
13
|
-
id?: string;
|
|
14
|
-
label: ObjectClass;
|
|
15
|
-
confidence: number;
|
|
16
|
-
boundingBox: BoundingBox;
|
|
17
|
-
inputWidth: number;
|
|
18
|
-
inputHeight: number;
|
|
19
|
-
origWidth: number;
|
|
20
|
-
origHeight: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface DetectionZone {
|
|
24
|
-
name: string;
|
|
25
|
-
points: Point[];
|
|
26
|
-
type: ZoneType;
|
|
27
|
-
filter: ZoneFilter;
|
|
28
|
-
classes: ObjectClass[];
|
|
29
|
-
isPrivacyMask: boolean;
|
|
30
|
-
color: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface CameraDetectionSettings {
|
|
34
|
-
object: {
|
|
35
|
-
confidence: number;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Mock-Hilfsfunktionen für Tests, angepasst für die neuen Tests
|
|
40
|
-
const convertBoundingBoxToPixels = (detection: Detection): Detection => {
|
|
41
|
-
// Vereinfacht für Tests
|
|
42
|
-
return detection;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const convertZonePointsToPixels = (zone: DetectionZone, detection: Detection): DetectionZone => {
|
|
46
|
-
// Vereinfacht für Tests
|
|
47
|
-
return zone;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const isBoxContainedInPolygon = (box: BoundingBox, polygon: Point[]): boolean => {
|
|
51
|
-
// Für Testzwecke: Box innerhalb eines Polygons basierend auf Markerpunkten
|
|
52
|
-
const centerX = (box[0] + box[2]) / 2;
|
|
53
|
-
const centerY = (box[1] + box[3]) / 2;
|
|
54
|
-
|
|
55
|
-
// Box in Include-Zone (enthalten)
|
|
56
|
-
if (polygon.some((p) => p[0] === 100 && p[1] === 100)) {
|
|
57
|
-
return centerX >= 90 && centerX <= 110 && centerY >= 90 && centerY <= 110;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Box in Exclude-Zone (enthalten)
|
|
61
|
-
else if (polygon.some((p) => p[0] === 200 && p[1] === 200)) {
|
|
62
|
-
return centerX >= 190 && centerX <= 210 && centerY >= 190 && centerY <= 210;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Box in Privacy-Mask (enthalten)
|
|
66
|
-
else if (polygon.some((p) => p[0] === 300 && p[1] === 300)) {
|
|
67
|
-
return centerX >= 290 && centerX <= 310 && centerY >= 290 && centerY <= 310;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return false;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const doPolygonsIntersect = (box: BoundingBox, polygon: Point[]): boolean => {
|
|
74
|
-
// Für Testzwecke: Größerer Bereich für Schnitttest
|
|
75
|
-
const centerX = (box[0] + box[2]) / 2;
|
|
76
|
-
const centerY = (box[1] + box[3]) / 2;
|
|
77
|
-
|
|
78
|
-
// Für Include-Zone (größerer Bereich für Schnitt)
|
|
79
|
-
if (polygon.some((p) => p[0] === 100 && p[1] === 100)) {
|
|
80
|
-
return centerX >= 70 && centerX <= 130 && centerY >= 70 && centerY <= 130;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Für Exclude-Zone (größerer Bereich für Schnitt)
|
|
84
|
-
else if (polygon.some((p) => p[0] === 200 && p[1] === 200)) {
|
|
85
|
-
return centerX >= 170 && centerX <= 230 && centerY >= 170 && centerY <= 230;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Für Privacy-Mask
|
|
89
|
-
else if (polygon.some((p) => p[0] === 300 && p[1] === 300)) {
|
|
90
|
-
return centerX >= 280 && centerX <= 320 && centerY >= 280 && centerY <= 320;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return false;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const isBoxCompletelyOutsidePolygon = (box: BoundingBox, polygon: Point[]): boolean => {
|
|
97
|
-
// Umkehrung von doPolygonsIntersect
|
|
98
|
-
return !doPolygonsIntersect(box, polygon);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// Implementation der korrigierten Funktion
|
|
102
|
-
const areDetectionsValid = (detections: Detection[], zones: DetectionZone[], activitySettings: CameraDetectionSettings): Detection[] => {
|
|
103
|
-
if (zones.length === 0) {
|
|
104
|
-
return [];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Sammle alle gültigen Klassen
|
|
108
|
-
const validClasses = new Set<ObjectClass>();
|
|
109
|
-
for (const zone of zones) {
|
|
110
|
-
if (zone.classes.length > 0) {
|
|
111
|
-
zone.classes.forEach((cls) => validClasses.add(cls));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return detections.filter((detection) => {
|
|
116
|
-
// Prüfe, ob die Detection eine gültige Konfidenz hat
|
|
117
|
-
if (detection.confidence < activitySettings.object.confidence) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Prüfe, ob die Detection überhaupt eine gültige Klasse hat
|
|
122
|
-
// (nur wenn es definierte Klassen gibt)
|
|
123
|
-
if (!validClasses.has(detection.label)) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const convertedDetection = convertBoundingBoxToPixels(detection);
|
|
128
|
-
|
|
129
|
-
// Check if detection is inside a privacy mask
|
|
130
|
-
for (const zone of zones) {
|
|
131
|
-
if (!zone.isPrivacyMask) continue;
|
|
132
|
-
|
|
133
|
-
const convertedZone = convertZonePointsToPixels(zone, convertedDetection);
|
|
134
|
-
if (isBoxContainedInPolygon(convertedDetection.boundingBox, convertedZone.points)) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
let hasIncludeZone = false;
|
|
140
|
-
let isValidForInclude = false;
|
|
141
|
-
let shouldExclude = false;
|
|
142
|
-
|
|
143
|
-
for (const zone of zones) {
|
|
144
|
-
if (zone.isPrivacyMask) continue;
|
|
145
|
-
|
|
146
|
-
if (zone.classes.length > 0 && !zone.classes.includes(detection.label)) {
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const convertedZone = convertZonePointsToPixels(zone, convertedDetection);
|
|
151
|
-
const intersects = doPolygonsIntersect(convertedDetection.boundingBox, convertedZone.points);
|
|
152
|
-
const contained = isBoxContainedInPolygon(convertedDetection.boundingBox, convertedZone.points);
|
|
153
|
-
|
|
154
|
-
if (zone.filter === 'include') {
|
|
155
|
-
hasIncludeZone = true;
|
|
156
|
-
if ((zone.type === 'contain' && contained) || (zone.type === 'intersect' && (intersects || contained))) {
|
|
157
|
-
isValidForInclude = true;
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
} else {
|
|
161
|
-
// exclude
|
|
162
|
-
if (zone.type === 'contain') {
|
|
163
|
-
if (!isBoxCompletelyOutsidePolygon(convertedDetection.boundingBox, convertedZone.points)) {
|
|
164
|
-
shouldExclude = true;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
} else {
|
|
168
|
-
// intersect
|
|
169
|
-
if (intersects || contained) {
|
|
170
|
-
shouldExclude = true;
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Wenn die Detection ausgeschlossen werden soll, überspringe sie
|
|
178
|
-
if (shouldExclude) {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Wenn es Include-Zonen gibt, muss die Detection mindestens eine erfüllen
|
|
183
|
-
// Wenn es keine Include-Zonen gibt, ist die Detection gültig (da sie nicht ausgeschlossen wurde)
|
|
184
|
-
return !hasIncludeZone || isValidForInclude;
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
describe('Object Detection Validation', () => {
|
|
189
|
-
let activitySettings: CameraDetectionSettings;
|
|
190
|
-
|
|
191
|
-
// Zones
|
|
192
|
-
let includeContainZone: DetectionZone;
|
|
193
|
-
let includeIntersectZone: DetectionZone;
|
|
194
|
-
let excludeContainZone: DetectionZone;
|
|
195
|
-
let excludeIntersectZone: DetectionZone;
|
|
196
|
-
let privacyMask: DetectionZone;
|
|
197
|
-
|
|
198
|
-
// Detections
|
|
199
|
-
let personDetectionInInclude: Detection;
|
|
200
|
-
let animalDetectionNearInclude: Detection;
|
|
201
|
-
let vehicleDetectionInExclude: Detection;
|
|
202
|
-
let motionDetectionNearExclude: Detection;
|
|
203
|
-
let personDetectionInPrivacy: Detection;
|
|
204
|
-
let otherDetectionHighConfidence: Detection;
|
|
205
|
-
let otherDetectionLowConfidence: Detection;
|
|
206
|
-
|
|
207
|
-
beforeEach(() => {
|
|
208
|
-
// Setup activity settings
|
|
209
|
-
activitySettings = {
|
|
210
|
-
object: {
|
|
211
|
-
confidence: 0.5,
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
// Setup zones
|
|
216
|
-
includeContainZone = {
|
|
217
|
-
name: 'Include Contain Zone',
|
|
218
|
-
points: [
|
|
219
|
-
[90, 90],
|
|
220
|
-
[110, 90],
|
|
221
|
-
[110, 110],
|
|
222
|
-
[90, 110],
|
|
223
|
-
[90, 90],
|
|
224
|
-
[100, 100],
|
|
225
|
-
], // Last point is a marker
|
|
226
|
-
type: 'contain',
|
|
227
|
-
filter: 'include',
|
|
228
|
-
classes: ['person', 'vehicle'],
|
|
229
|
-
isPrivacyMask: false,
|
|
230
|
-
color: 'green',
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
includeIntersectZone = {
|
|
234
|
-
name: 'Include Intersect Zone',
|
|
235
|
-
points: [
|
|
236
|
-
[90, 90],
|
|
237
|
-
[110, 90],
|
|
238
|
-
[110, 110],
|
|
239
|
-
[90, 110],
|
|
240
|
-
[90, 90],
|
|
241
|
-
[100, 100],
|
|
242
|
-
], // Last point is a marker
|
|
243
|
-
type: 'intersect',
|
|
244
|
-
filter: 'include',
|
|
245
|
-
classes: ['animal', 'motion'],
|
|
246
|
-
isPrivacyMask: false,
|
|
247
|
-
color: 'blue',
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
excludeContainZone = {
|
|
251
|
-
name: 'Exclude Contain Zone',
|
|
252
|
-
points: [
|
|
253
|
-
[190, 190],
|
|
254
|
-
[210, 190],
|
|
255
|
-
[210, 210],
|
|
256
|
-
[190, 210],
|
|
257
|
-
[190, 190],
|
|
258
|
-
[200, 200],
|
|
259
|
-
], // Last point is a marker
|
|
260
|
-
type: 'contain',
|
|
261
|
-
filter: 'exclude',
|
|
262
|
-
classes: ['person', 'vehicle'],
|
|
263
|
-
isPrivacyMask: false,
|
|
264
|
-
color: 'red',
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
excludeIntersectZone = {
|
|
268
|
-
name: 'Exclude Intersect Zone',
|
|
269
|
-
points: [
|
|
270
|
-
[190, 190],
|
|
271
|
-
[210, 190],
|
|
272
|
-
[210, 210],
|
|
273
|
-
[190, 210],
|
|
274
|
-
[190, 190],
|
|
275
|
-
[200, 200],
|
|
276
|
-
], // Last point is a marker
|
|
277
|
-
type: 'intersect',
|
|
278
|
-
filter: 'exclude',
|
|
279
|
-
classes: ['animal', 'motion'],
|
|
280
|
-
isPrivacyMask: false,
|
|
281
|
-
color: 'orange',
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
privacyMask = {
|
|
285
|
-
name: 'Privacy Mask',
|
|
286
|
-
points: [
|
|
287
|
-
[290, 290],
|
|
288
|
-
[310, 290],
|
|
289
|
-
[310, 310],
|
|
290
|
-
[290, 310],
|
|
291
|
-
[290, 290],
|
|
292
|
-
[300, 300],
|
|
293
|
-
], // Last point is a marker
|
|
294
|
-
type: 'contain',
|
|
295
|
-
filter: 'include',
|
|
296
|
-
classes: [],
|
|
297
|
-
isPrivacyMask: true,
|
|
298
|
-
color: 'black',
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
// Setup detections
|
|
302
|
-
personDetectionInInclude = {
|
|
303
|
-
id: '1',
|
|
304
|
-
label: 'person',
|
|
305
|
-
confidence: 0.8,
|
|
306
|
-
boundingBox: [95, 95, 105, 105],
|
|
307
|
-
inputWidth: 320,
|
|
308
|
-
inputHeight: 320,
|
|
309
|
-
origWidth: 640,
|
|
310
|
-
origHeight: 360,
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
animalDetectionNearInclude = {
|
|
314
|
-
id: '2',
|
|
315
|
-
label: 'animal',
|
|
316
|
-
confidence: 0.7,
|
|
317
|
-
boundingBox: [75, 75, 85, 85], // Near include zone, should be detected by intersect
|
|
318
|
-
inputWidth: 320,
|
|
319
|
-
inputHeight: 320,
|
|
320
|
-
origWidth: 640,
|
|
321
|
-
origHeight: 360,
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
vehicleDetectionInExclude = {
|
|
325
|
-
id: '3',
|
|
326
|
-
label: 'vehicle',
|
|
327
|
-
confidence: 0.9,
|
|
328
|
-
boundingBox: [195, 195, 205, 205],
|
|
329
|
-
inputWidth: 320,
|
|
330
|
-
inputHeight: 320,
|
|
331
|
-
origWidth: 640,
|
|
332
|
-
origHeight: 360,
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
motionDetectionNearExclude = {
|
|
336
|
-
id: '4',
|
|
337
|
-
label: 'motion',
|
|
338
|
-
confidence: 0.6,
|
|
339
|
-
boundingBox: [175, 175, 185, 185], // Near exclude zone, should be detected by intersect
|
|
340
|
-
inputWidth: 320,
|
|
341
|
-
inputHeight: 320,
|
|
342
|
-
origWidth: 640,
|
|
343
|
-
origHeight: 360,
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
personDetectionInPrivacy = {
|
|
347
|
-
id: '5',
|
|
348
|
-
label: 'person',
|
|
349
|
-
confidence: 0.95,
|
|
350
|
-
boundingBox: [295, 295, 305, 305],
|
|
351
|
-
inputWidth: 320,
|
|
352
|
-
inputHeight: 320,
|
|
353
|
-
origWidth: 640,
|
|
354
|
-
origHeight: 360,
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
otherDetectionHighConfidence = {
|
|
358
|
-
id: '6',
|
|
359
|
-
label: 'other',
|
|
360
|
-
confidence: 0.85,
|
|
361
|
-
boundingBox: [50, 50, 60, 60],
|
|
362
|
-
inputWidth: 320,
|
|
363
|
-
inputHeight: 320,
|
|
364
|
-
origWidth: 640,
|
|
365
|
-
origHeight: 360,
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
otherDetectionLowConfidence = {
|
|
369
|
-
id: '7',
|
|
370
|
-
label: 'other',
|
|
371
|
-
confidence: 0.3, // Below threshold
|
|
372
|
-
boundingBox: [150, 150, 160, 160],
|
|
373
|
-
inputWidth: 320,
|
|
374
|
-
inputHeight: 320,
|
|
375
|
-
origWidth: 640,
|
|
376
|
-
origHeight: 360,
|
|
377
|
-
};
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
it('should return empty array when no zones are provided', () => {
|
|
381
|
-
const result = areDetectionsValid([personDetectionInInclude], [], activitySettings);
|
|
382
|
-
expect(result).toEqual([]);
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
it('should filter out detections below confidence threshold', () => {
|
|
386
|
-
const result = areDetectionsValid([otherDetectionLowConfidence], [includeContainZone], activitySettings);
|
|
387
|
-
expect(result).toEqual([]);
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
it('should only include detections with classes defined in zones', () => {
|
|
391
|
-
const result = areDetectionsValid([otherDetectionHighConfidence, personDetectionInInclude], [includeContainZone], activitySettings);
|
|
392
|
-
|
|
393
|
-
// Only the person detection should be valid, not "other"
|
|
394
|
-
expect(result.length).toBe(1);
|
|
395
|
-
expect(result[0].id).toBe('1'); // person detection
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
it('should filter out detections in privacy mask', () => {
|
|
399
|
-
const result = areDetectionsValid([personDetectionInPrivacy], [privacyMask, includeContainZone], activitySettings);
|
|
400
|
-
expect(result).toEqual([]);
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
it('should include detections contained in include+contain zone', () => {
|
|
404
|
-
const result = areDetectionsValid([personDetectionInInclude], [includeContainZone], activitySettings);
|
|
405
|
-
expect(result.length).toBe(1);
|
|
406
|
-
expect(result[0].id).toBe('1');
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
it('should include detections intersecting with include+intersect zone', () => {
|
|
410
|
-
const result = areDetectionsValid([animalDetectionNearInclude], [includeIntersectZone], activitySettings);
|
|
411
|
-
expect(result.length).toBe(1);
|
|
412
|
-
expect(result[0].id).toBe('2');
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
it('should exclude detections contained in exclude+contain zone', () => {
|
|
416
|
-
const result = areDetectionsValid([vehicleDetectionInExclude], [excludeContainZone, includeContainZone], activitySettings);
|
|
417
|
-
expect(result).toEqual([]);
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
it('should exclude detections intersecting with exclude+intersect zone', () => {
|
|
421
|
-
const result = areDetectionsValid([motionDetectionNearExclude], [excludeIntersectZone, includeIntersectZone], activitySettings);
|
|
422
|
-
expect(result).toEqual([]);
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
it('should correctly handle scenario with no include zones', () => {
|
|
426
|
-
// With only exclude zones, valid classes should still be checked
|
|
427
|
-
const result = areDetectionsValid(
|
|
428
|
-
[otherDetectionHighConfidence, personDetectionInInclude],
|
|
429
|
-
[excludeContainZone], // Only exclude zone with person/vehicle classes
|
|
430
|
-
activitySettings,
|
|
431
|
-
);
|
|
432
|
-
|
|
433
|
-
// Only person should be valid (in valid classes but not in exclude zone)
|
|
434
|
-
// "other" should be invalid because it's not in valid classes
|
|
435
|
-
expect(result.length).toBe(1);
|
|
436
|
-
expect(result[0].id).toBe('1');
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
it('should correctly handle complex scenario with multiple zones and detections', () => {
|
|
440
|
-
const zones = [includeContainZone, includeIntersectZone, excludeContainZone, excludeIntersectZone, privacyMask];
|
|
441
|
-
|
|
442
|
-
const detections = [
|
|
443
|
-
personDetectionInInclude, // Valid: in include zone
|
|
444
|
-
animalDetectionNearInclude, // Valid: intersects with include
|
|
445
|
-
vehicleDetectionInExclude, // Invalid: in exclude zone
|
|
446
|
-
motionDetectionNearExclude, // Invalid: intersects with exclude
|
|
447
|
-
personDetectionInPrivacy, // Invalid: in privacy mask
|
|
448
|
-
otherDetectionHighConfidence, // Invalid: not in valid classes
|
|
449
|
-
otherDetectionLowConfidence, // Invalid: below confidence threshold
|
|
450
|
-
];
|
|
451
|
-
|
|
452
|
-
const result = areDetectionsValid(detections, zones, activitySettings);
|
|
453
|
-
|
|
454
|
-
// Only person in include and animal near include should be valid
|
|
455
|
-
expect(result.length).toBe(2);
|
|
456
|
-
const ids = result.map((d) => d.id);
|
|
457
|
-
expect(ids).toContain('1'); // person in include
|
|
458
|
-
expect(ids).toContain('2'); // animal near include
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
it('should handle empty classes arrays correctly', () => {
|
|
462
|
-
// Create a zone with no class restrictions
|
|
463
|
-
const noClassZone: DetectionZone = {
|
|
464
|
-
name: 'No Class Zone',
|
|
465
|
-
points: [
|
|
466
|
-
[90, 90],
|
|
467
|
-
[110, 90],
|
|
468
|
-
[110, 110],
|
|
469
|
-
[90, 110],
|
|
470
|
-
[90, 90],
|
|
471
|
-
[100, 100],
|
|
472
|
-
],
|
|
473
|
-
type: 'contain',
|
|
474
|
-
filter: 'include',
|
|
475
|
-
classes: [],
|
|
476
|
-
isPrivacyMask: false,
|
|
477
|
-
color: 'purple',
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
const result = areDetectionsValid([otherDetectionHighConfidence], [noClassZone], activitySettings);
|
|
481
|
-
|
|
482
|
-
// Should include "other" since no class restrictions
|
|
483
|
-
expect(result.length).toBe(1);
|
|
484
|
-
expect(result[0].id).toBe('6');
|
|
485
|
-
});
|
|
486
|
-
|
|
487
|
-
it('should respect include zone type when determining validity', () => {
|
|
488
|
-
// Create a special include zone that only works with "contain" not "intersect"
|
|
489
|
-
const strictIncludeZone: DetectionZone = {
|
|
490
|
-
name: 'Strict Include Zone',
|
|
491
|
-
points: [
|
|
492
|
-
[90, 90],
|
|
493
|
-
[110, 90],
|
|
494
|
-
[110, 110],
|
|
495
|
-
[90, 110],
|
|
496
|
-
[90, 90],
|
|
497
|
-
[100, 100],
|
|
498
|
-
],
|
|
499
|
-
type: 'contain', // This is strict - must be contained, not just intersect
|
|
500
|
-
filter: 'include',
|
|
501
|
-
classes: ['animal'],
|
|
502
|
-
isPrivacyMask: false,
|
|
503
|
-
color: 'yellow',
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
// This detection is near but not contained in the zone
|
|
507
|
-
const result = areDetectionsValid([animalDetectionNearInclude], [strictIncludeZone], activitySettings);
|
|
508
|
-
|
|
509
|
-
// Should not include the animal since it only intersects but doesn't contain
|
|
510
|
-
expect(result).toEqual([]);
|
|
511
|
-
});
|
|
512
|
-
|
|
513
|
-
it('should correctly handle combined class filters from multiple zones', () => {
|
|
514
|
-
// Create zones with different class filters
|
|
515
|
-
const personZone: DetectionZone = {
|
|
516
|
-
name: 'Person Zone',
|
|
517
|
-
points: [
|
|
518
|
-
[90, 90],
|
|
519
|
-
[110, 90],
|
|
520
|
-
[110, 110],
|
|
521
|
-
[90, 110],
|
|
522
|
-
[90, 90],
|
|
523
|
-
[100, 100],
|
|
524
|
-
],
|
|
525
|
-
type: 'contain',
|
|
526
|
-
filter: 'include',
|
|
527
|
-
classes: ['person'],
|
|
528
|
-
isPrivacyMask: false,
|
|
529
|
-
color: 'blue',
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
const vehicleZone: DetectionZone = {
|
|
533
|
-
name: 'Vehicle Zone',
|
|
534
|
-
points: [
|
|
535
|
-
[120, 120],
|
|
536
|
-
[140, 120],
|
|
537
|
-
[140, 140],
|
|
538
|
-
[120, 140],
|
|
539
|
-
[120, 120],
|
|
540
|
-
[130, 130],
|
|
541
|
-
],
|
|
542
|
-
type: 'contain',
|
|
543
|
-
filter: 'include',
|
|
544
|
-
classes: ['vehicle'],
|
|
545
|
-
isPrivacyMask: false,
|
|
546
|
-
color: 'green',
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
// Test with a detection that doesn't match any zone's position criteria
|
|
550
|
-
// but has a label that is in the combined valid classes
|
|
551
|
-
const vehicleDetectionOutsideZones: Detection = {
|
|
552
|
-
id: '8',
|
|
553
|
-
label: 'vehicle',
|
|
554
|
-
confidence: 0.75,
|
|
555
|
-
boundingBox: [50, 50, 60, 60], // Outside both zones
|
|
556
|
-
inputWidth: 320,
|
|
557
|
-
inputHeight: 320,
|
|
558
|
-
origWidth: 640,
|
|
559
|
-
origHeight: 360,
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
const result = areDetectionsValid([otherDetectionHighConfidence, vehicleDetectionOutsideZones], [personZone, vehicleZone], activitySettings);
|
|
563
|
-
|
|
564
|
-
// Should not include any detections since neither is in a zone,
|
|
565
|
-
// and both zones are "include" zones requiring detection to be in the zone
|
|
566
|
-
expect(result).toEqual([]);
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
it('should prioritize exclude zones over include zones', () => {
|
|
570
|
-
// Create an overlapping include and exclude zone
|
|
571
|
-
const overlapZoneInclude: DetectionZone = {
|
|
572
|
-
name: 'Overlap Include Zone',
|
|
573
|
-
points: [
|
|
574
|
-
[90, 90],
|
|
575
|
-
[110, 90],
|
|
576
|
-
[110, 110],
|
|
577
|
-
[90, 110],
|
|
578
|
-
[90, 90],
|
|
579
|
-
[100, 100],
|
|
580
|
-
],
|
|
581
|
-
type: 'contain',
|
|
582
|
-
filter: 'include',
|
|
583
|
-
classes: ['person'],
|
|
584
|
-
isPrivacyMask: false,
|
|
585
|
-
color: 'green',
|
|
586
|
-
};
|
|
587
|
-
|
|
588
|
-
const overlapZoneExclude: DetectionZone = {
|
|
589
|
-
name: 'Overlap Exclude Zone',
|
|
590
|
-
points: [
|
|
591
|
-
[90, 90],
|
|
592
|
-
[110, 90],
|
|
593
|
-
[110, 110],
|
|
594
|
-
[90, 110],
|
|
595
|
-
[90, 90],
|
|
596
|
-
[100, 100],
|
|
597
|
-
],
|
|
598
|
-
type: 'contain',
|
|
599
|
-
filter: 'exclude',
|
|
600
|
-
classes: ['person'],
|
|
601
|
-
isPrivacyMask: false,
|
|
602
|
-
color: 'red',
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
// A person detection in the overlapping zone
|
|
606
|
-
const result = areDetectionsValid([personDetectionInInclude], [overlapZoneInclude, overlapZoneExclude], activitySettings);
|
|
607
|
-
|
|
608
|
-
// Should exclude the person since exclude takes priority
|
|
609
|
-
expect(result).toEqual([]);
|
|
610
|
-
});
|
|
611
|
-
});
|