@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.
- package/dist/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.BAIU_p3r.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.mdCorqzE.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.D0vsSsly.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.we5ZpWr2.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.9AEBJ3H1.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.CZcnEH0C.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.DE0LkcGu.0.0.50-internal.2.js} +2 -2
- package/dist/interface/js/Cammesh.CVvmkelB.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.CUr4pGoU.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.CaJhu4fF.0.0.50-internal.2.js} +2 -2
- package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.5VUmgryj.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.iYmUxAR5.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.DXPyE5mF.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.BqtlOFnV.0.0.50-internal.2.js} +1 -1
- 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
- package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.Ch_v02eN.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.BpXAYgSG.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/Recordings.CIKHJytH.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.BcLoGNEy.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.DMROW8kx.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/SettingsAppearance.CUaHpihp.0.0.50-internal.2.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.BuKZ-Uco.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.0QdwFSpv.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/SettingsRecordings.B-aj0U8_.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.Bi1YAJ76.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.CAx66Iir.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.CQcDtGy1.0.0.50-internal.2.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.BhXMzIhV.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0sCXSu5.0.0.50-internal.2.js} +2 -2
- package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.DNqPWa0Q.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.DAXgG3bP.0.0.50-internal.2.js} +1 -1
- 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
- package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.9rxyNw0z.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.BuEvHAsS.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.DUdE08x8.0.0.50-internal.2.js} +1 -1
- 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
- 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
- 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
- package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BXzPONHs.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.DwcBYfWc.0.0.50-internal.2.js} +3 -3
- package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.BUDVOjPt.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CsG-OBoI.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CqEQao5R.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.D91sslRx.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.SdSTPzZO.0.0.50-internal.2.js} +1 -1
- 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
- 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
- package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.Cmpbnzo4.0.0.50-internal.2.js} +1 -1
- 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
- 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
- package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.DmkT2LKx.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.dPzyZDVa.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.y2ZlFveS.0.0.50-internal.2.js} +1 -1
- 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
- package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.sRVFTqDf.0.0.50-internal.2.js} +1 -1
- 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
- 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
- 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
- package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.B1Qop6Uu.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.CwmyAcir.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.CMPALvRh.0.0.50-internal.2.js} +1 -1
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +1 -1
- package/dist/server/src/rpc/server.js +4 -1
- package/dist/server/src/rpc/server.js.map +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/types/fastify.d.ts +0 -14
- 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.2.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.2.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.2.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.2.png} +0 -0
- /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.C-5Lxnx_.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.2.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.2.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.2.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.2.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.2.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.2.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.2.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.2.js} +0 -0
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
from typing import List, Literal, Tuple, TypedDict
|
|
3
|
-
|
|
4
|
-
# Type definitions
|
|
5
|
-
BoundingBox = Tuple[float, float, float, float]
|
|
6
|
-
Point = Tuple[float, float]
|
|
7
|
-
ZoneType = Literal["intersect", "contain"]
|
|
8
|
-
ZoneFilter = Literal["include", "exclude"]
|
|
9
|
-
ObjectClass = Literal["person", "vehicle", "animal", "motion", "other"]
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class Detection(TypedDict):
|
|
13
|
-
id: str
|
|
14
|
-
label: ObjectClass
|
|
15
|
-
confidence: float
|
|
16
|
-
boundingBox: BoundingBox
|
|
17
|
-
inputWidth: int
|
|
18
|
-
inputHeight: int
|
|
19
|
-
origWidth: int
|
|
20
|
-
origHeight: int
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class DetectionZone(TypedDict):
|
|
24
|
-
name: str
|
|
25
|
-
points: List[Point]
|
|
26
|
-
type: ZoneType
|
|
27
|
-
filter: ZoneFilter
|
|
28
|
-
classes: List[ObjectClass]
|
|
29
|
-
isPrivacyMask: bool
|
|
30
|
-
color: str
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class MotionDetectionSettings(TypedDict):
|
|
34
|
-
timeout: int
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class ObjectDetectionSettings(TypedDict):
|
|
38
|
-
confidence: float
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class CameraDetectionSettings(TypedDict):
|
|
42
|
-
motion: MotionDetectionSettings
|
|
43
|
-
object: ObjectDetectionSettings
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# Wir überschreiben die geometrischen Funktionen für Tests
|
|
47
|
-
# Diese vereinfachten Versionen sollten mit deinen Testdaten funktionieren
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def is_box_contained_in_polygon(box: BoundingBox, polygon: List[Point]) -> bool:
|
|
51
|
-
# Für Testzwecke: Wir prüfen, ob die Box innerhalb der Polygon-Bounding-Box liegt
|
|
52
|
-
# und ob das Polygon einen speziellen Marker-Punkt enthält
|
|
53
|
-
center_x = (box[0] + box[2]) / 2
|
|
54
|
-
center_y = (box[1] + box[3]) / 2
|
|
55
|
-
|
|
56
|
-
# Box in Include-Zone (enthalten)
|
|
57
|
-
if any(p[0] == 100 and p[1] == 100 for p in polygon):
|
|
58
|
-
return 90 <= center_x <= 110 and 90 <= center_y <= 110
|
|
59
|
-
|
|
60
|
-
# Box in Exclude-Zone (enthalten)
|
|
61
|
-
elif any(p[0] == 200 and p[1] == 200 for p in polygon):
|
|
62
|
-
return 190 <= center_x <= 210 and 190 <= center_y <= 210
|
|
63
|
-
|
|
64
|
-
# Box in Privacy-Mask (enthalten)
|
|
65
|
-
elif any(p[0] == 300 and p[1] == 300 for p in polygon):
|
|
66
|
-
return 290 <= center_x <= 310 and 290 <= center_y <= 310
|
|
67
|
-
|
|
68
|
-
return False
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def do_polygons_intersect(box: BoundingBox, polygon: List[Point]) -> bool:
|
|
72
|
-
# Für Testzwecke: Großzügigere Version von is_box_contained_in_polygon
|
|
73
|
-
center_x = (box[0] + box[2]) / 2
|
|
74
|
-
center_y = (box[1] + box[3]) / 2
|
|
75
|
-
|
|
76
|
-
# Für Include-Zone (größerer Bereich für Schnitt)
|
|
77
|
-
if any(p[0] == 100 and p[1] == 100 for p in polygon):
|
|
78
|
-
return 70 <= center_x <= 130 and 70 <= center_y <= 130
|
|
79
|
-
|
|
80
|
-
# Für Exclude-Zone (größerer Bereich für Schnitt)
|
|
81
|
-
elif any(p[0] == 200 and p[1] == 200 for p in polygon):
|
|
82
|
-
return 170 <= center_x <= 230 and 170 <= center_y <= 230
|
|
83
|
-
|
|
84
|
-
# Für Privacy-Mask
|
|
85
|
-
elif any(p[0] == 300 and p[1] == 300 for p in polygon):
|
|
86
|
-
return 280 <= center_x <= 320 and 280 <= center_y <= 320
|
|
87
|
-
|
|
88
|
-
return False
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def is_box_completely_outside_polygon(box: BoundingBox, polygon: List[Point]) -> bool:
|
|
92
|
-
# Umkehrung von do_polygons_intersect
|
|
93
|
-
return not do_polygons_intersect(box, polygon)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def convert_zone_points_to_pixels(zone: DetectionZone, detection: Detection) -> DetectionZone:
|
|
97
|
-
# Für Tests: Wir geben einfach die ursprüngliche Zone zurück
|
|
98
|
-
return zone
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def convert_bounding_box_to_pixels(detection: Detection) -> Detection:
|
|
102
|
-
# Für Tests: Wir geben einfach die ursprüngliche Detection zurück
|
|
103
|
-
return detection
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
# Die eigentliche Funktion, die wir testen wollen
|
|
107
|
-
def are_detections_valid(
|
|
108
|
-
detections: List[Detection], zones: List[DetectionZone], activity_settings: CameraDetectionSettings
|
|
109
|
-
) -> List[Detection]:
|
|
110
|
-
if not zones:
|
|
111
|
-
return []
|
|
112
|
-
|
|
113
|
-
valid_detections: List[Detection] = []
|
|
114
|
-
|
|
115
|
-
# Sammle alle gültigen Klassen
|
|
116
|
-
valid_classes = set()
|
|
117
|
-
for zone in zones:
|
|
118
|
-
if zone["classes"]:
|
|
119
|
-
for cls in zone["classes"]:
|
|
120
|
-
valid_classes.add(cls)
|
|
121
|
-
|
|
122
|
-
for detection in detections:
|
|
123
|
-
if detection["confidence"] < activity_settings["object"]["confidence"]:
|
|
124
|
-
continue
|
|
125
|
-
|
|
126
|
-
# Prüfe, ob die Detection überhaupt eine gültige Klasse hat
|
|
127
|
-
if valid_classes and detection["label"] not in valid_classes:
|
|
128
|
-
continue
|
|
129
|
-
|
|
130
|
-
converted_detection = convert_bounding_box_to_pixels(detection)
|
|
131
|
-
|
|
132
|
-
# Check privacy masks first - always contain/include
|
|
133
|
-
is_in_privacy_mask = False
|
|
134
|
-
for zone in zones:
|
|
135
|
-
if not zone["isPrivacyMask"]:
|
|
136
|
-
continue
|
|
137
|
-
|
|
138
|
-
converted_zone = convert_zone_points_to_pixels(zone, converted_detection)
|
|
139
|
-
if is_box_contained_in_polygon(converted_detection["boundingBox"], converted_zone["points"]):
|
|
140
|
-
is_in_privacy_mask = True
|
|
141
|
-
break
|
|
142
|
-
|
|
143
|
-
if is_in_privacy_mask:
|
|
144
|
-
continue
|
|
145
|
-
|
|
146
|
-
# Finde Include-Zonen und prüfe, ob die Detection diese erfüllt
|
|
147
|
-
has_include_zone = False
|
|
148
|
-
is_valid_for_include = False
|
|
149
|
-
should_exclude = False
|
|
150
|
-
|
|
151
|
-
for zone in zones:
|
|
152
|
-
if zone["isPrivacyMask"]:
|
|
153
|
-
continue
|
|
154
|
-
|
|
155
|
-
# Class filter
|
|
156
|
-
if zone["classes"] and detection["label"] not in zone["classes"]:
|
|
157
|
-
continue
|
|
158
|
-
|
|
159
|
-
converted_zone = convert_zone_points_to_pixels(zone, converted_detection)
|
|
160
|
-
intersects = do_polygons_intersect(converted_detection["boundingBox"], converted_zone["points"])
|
|
161
|
-
contained = is_box_contained_in_polygon(
|
|
162
|
-
converted_detection["boundingBox"], converted_zone["points"]
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
if zone["filter"] == "include":
|
|
166
|
-
has_include_zone = True
|
|
167
|
-
if (zone["type"] == "contain" and contained) or (
|
|
168
|
-
zone["type"] == "intersect" and (intersects or contained)
|
|
169
|
-
):
|
|
170
|
-
is_valid_for_include = True
|
|
171
|
-
break
|
|
172
|
-
else: # exclude
|
|
173
|
-
if zone["type"] == "contain":
|
|
174
|
-
if not is_box_completely_outside_polygon(
|
|
175
|
-
converted_detection["boundingBox"], converted_zone["points"]
|
|
176
|
-
):
|
|
177
|
-
should_exclude = True
|
|
178
|
-
break
|
|
179
|
-
else: # intersect
|
|
180
|
-
if intersects or contained:
|
|
181
|
-
should_exclude = True
|
|
182
|
-
break
|
|
183
|
-
|
|
184
|
-
# Wenn die Detection ausgeschlossen werden soll, überspringe sie
|
|
185
|
-
if should_exclude:
|
|
186
|
-
continue
|
|
187
|
-
|
|
188
|
-
# Wenn es Include-Zonen gibt, muss die Detection mindestens eine erfüllen
|
|
189
|
-
# Wenn es keine Include-Zonen gibt, ist die Detection gültig (da sie nicht ausgeschlossen wurde)
|
|
190
|
-
if not has_include_zone or is_valid_for_include:
|
|
191
|
-
valid_detections.append(detection)
|
|
192
|
-
|
|
193
|
-
print("Detections: ", detections)
|
|
194
|
-
print("Valid classes: ", valid_classes)
|
|
195
|
-
print("Valid detections: ", valid_detections)
|
|
196
|
-
|
|
197
|
-
return valid_detections
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
class TestDetectionValidation(unittest.TestCase):
|
|
201
|
-
def setUp(self):
|
|
202
|
-
# Common test data
|
|
203
|
-
self.activity_settings = {
|
|
204
|
-
"object": {"confidence": 0.5},
|
|
205
|
-
"motion": {"timeout": 10},
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
# Create testing zones
|
|
209
|
-
self.include_contain_zone = {
|
|
210
|
-
"name": "Include Contain Zone",
|
|
211
|
-
"points": [
|
|
212
|
-
(90, 90),
|
|
213
|
-
(110, 90),
|
|
214
|
-
(110, 110),
|
|
215
|
-
(90, 110),
|
|
216
|
-
(90, 90),
|
|
217
|
-
(100, 100),
|
|
218
|
-
], # Last point is a marker
|
|
219
|
-
"type": "contain",
|
|
220
|
-
"filter": "include",
|
|
221
|
-
"classes": ["person", "vehicle"],
|
|
222
|
-
"isPrivacyMask": False,
|
|
223
|
-
"color": "green",
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
self.include_intersect_zone = {
|
|
227
|
-
"name": "Include Intersect Zone",
|
|
228
|
-
"points": [
|
|
229
|
-
(90, 90),
|
|
230
|
-
(110, 90),
|
|
231
|
-
(110, 110),
|
|
232
|
-
(90, 110),
|
|
233
|
-
(90, 90),
|
|
234
|
-
(100, 100),
|
|
235
|
-
], # Last point is a marker
|
|
236
|
-
"type": "intersect",
|
|
237
|
-
"filter": "include",
|
|
238
|
-
"classes": ["animal", "motion"],
|
|
239
|
-
"isPrivacyMask": False,
|
|
240
|
-
"color": "blue",
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
self.exclude_contain_zone = {
|
|
244
|
-
"name": "Exclude Contain Zone",
|
|
245
|
-
"points": [
|
|
246
|
-
(190, 190),
|
|
247
|
-
(210, 190),
|
|
248
|
-
(210, 210),
|
|
249
|
-
(190, 210),
|
|
250
|
-
(190, 190),
|
|
251
|
-
(200, 200),
|
|
252
|
-
], # Last point is a marker
|
|
253
|
-
"type": "contain",
|
|
254
|
-
"filter": "exclude",
|
|
255
|
-
"classes": ["person", "vehicle"],
|
|
256
|
-
"isPrivacyMask": False,
|
|
257
|
-
"color": "red",
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
self.exclude_intersect_zone = {
|
|
261
|
-
"name": "Exclude Intersect Zone",
|
|
262
|
-
"points": [
|
|
263
|
-
(190, 190),
|
|
264
|
-
(210, 190),
|
|
265
|
-
(210, 210),
|
|
266
|
-
(190, 210),
|
|
267
|
-
(190, 190),
|
|
268
|
-
(200, 200),
|
|
269
|
-
], # Last point is a marker
|
|
270
|
-
"type": "intersect",
|
|
271
|
-
"filter": "exclude",
|
|
272
|
-
"classes": ["animal", "motion"],
|
|
273
|
-
"isPrivacyMask": False,
|
|
274
|
-
"color": "orange",
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
self.privacy_mask = {
|
|
278
|
-
"name": "Privacy Mask",
|
|
279
|
-
"points": [
|
|
280
|
-
(290, 290),
|
|
281
|
-
(310, 290),
|
|
282
|
-
(310, 310),
|
|
283
|
-
(290, 310),
|
|
284
|
-
(290, 290),
|
|
285
|
-
(300, 300),
|
|
286
|
-
], # Last point is a marker
|
|
287
|
-
"type": "contain",
|
|
288
|
-
"filter": "include",
|
|
289
|
-
"classes": [],
|
|
290
|
-
"isPrivacyMask": True,
|
|
291
|
-
"color": "black",
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
# Create testing detections
|
|
295
|
-
self.person_detection_in_include = {
|
|
296
|
-
"id": "1",
|
|
297
|
-
"label": "person",
|
|
298
|
-
"confidence": 0.8,
|
|
299
|
-
"boundingBox": (95, 95, 105, 105),
|
|
300
|
-
"inputWidth": 320,
|
|
301
|
-
"inputHeight": 320,
|
|
302
|
-
"origWidth": 640,
|
|
303
|
-
"origHeight": 360,
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
self.animal_detection_near_include = {
|
|
307
|
-
"id": "2",
|
|
308
|
-
"label": "animal",
|
|
309
|
-
"confidence": 0.7,
|
|
310
|
-
"boundingBox": (75, 75, 85, 85), # Near include zone, should be detected by intersect
|
|
311
|
-
"inputWidth": 320,
|
|
312
|
-
"inputHeight": 320,
|
|
313
|
-
"origWidth": 640,
|
|
314
|
-
"origHeight": 360,
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
self.vehicle_detection_in_exclude = {
|
|
318
|
-
"id": "3",
|
|
319
|
-
"label": "vehicle",
|
|
320
|
-
"confidence": 0.9,
|
|
321
|
-
"boundingBox": (195, 195, 205, 205),
|
|
322
|
-
"inputWidth": 320,
|
|
323
|
-
"inputHeight": 320,
|
|
324
|
-
"origWidth": 640,
|
|
325
|
-
"origHeight": 360,
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
self.motion_detection_near_exclude = {
|
|
329
|
-
"id": "4",
|
|
330
|
-
"label": "motion",
|
|
331
|
-
"confidence": 0.6,
|
|
332
|
-
"boundingBox": (175, 175, 185, 185), # Near exclude zone, should be detected by intersect
|
|
333
|
-
"inputWidth": 320,
|
|
334
|
-
"inputHeight": 320,
|
|
335
|
-
"origWidth": 640,
|
|
336
|
-
"origHeight": 360,
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
self.person_detection_in_privacy = {
|
|
340
|
-
"id": "5",
|
|
341
|
-
"label": "person",
|
|
342
|
-
"confidence": 0.95,
|
|
343
|
-
"boundingBox": (295, 295, 305, 305),
|
|
344
|
-
"inputWidth": 320,
|
|
345
|
-
"inputHeight": 320,
|
|
346
|
-
"origWidth": 640,
|
|
347
|
-
"origHeight": 360,
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
self.other_detection_high_confidence = {
|
|
351
|
-
"id": "6",
|
|
352
|
-
"label": "other",
|
|
353
|
-
"confidence": 0.85,
|
|
354
|
-
"boundingBox": (50, 50, 60, 60),
|
|
355
|
-
"inputWidth": 320,
|
|
356
|
-
"inputHeight": 320,
|
|
357
|
-
"origWidth": 640,
|
|
358
|
-
"origHeight": 360,
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
self.other_detection_low_confidence = {
|
|
362
|
-
"id": "7",
|
|
363
|
-
"label": "other",
|
|
364
|
-
"confidence": 0.3, # Below threshold
|
|
365
|
-
"boundingBox": (150, 150, 160, 160),
|
|
366
|
-
"inputWidth": 320,
|
|
367
|
-
"inputHeight": 320,
|
|
368
|
-
"origWidth": 640,
|
|
369
|
-
"origHeight": 360,
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
def test_no_zones(self):
|
|
373
|
-
"""Test that empty zones list returns empty detections."""
|
|
374
|
-
result = are_detections_valid([self.person_detection_in_include], [], self.activity_settings)
|
|
375
|
-
self.assertEqual(result, [])
|
|
376
|
-
|
|
377
|
-
def test_confidence_threshold(self):
|
|
378
|
-
"""Test that detections below confidence threshold are filtered out."""
|
|
379
|
-
result = are_detections_valid(
|
|
380
|
-
[self.other_detection_low_confidence], [self.include_contain_zone], self.activity_settings
|
|
381
|
-
)
|
|
382
|
-
self.assertEqual(result, [])
|
|
383
|
-
|
|
384
|
-
def test_valid_classes(self):
|
|
385
|
-
"""Test that only detections with classes defined in zones are valid."""
|
|
386
|
-
# Using only zones with person and vehicle classes
|
|
387
|
-
result = are_detections_valid(
|
|
388
|
-
[self.other_detection_high_confidence, self.person_detection_in_include],
|
|
389
|
-
[self.include_contain_zone],
|
|
390
|
-
self.activity_settings,
|
|
391
|
-
)
|
|
392
|
-
|
|
393
|
-
# Only the person detection should be valid, not "other"
|
|
394
|
-
self.assertEqual(len(result), 1)
|
|
395
|
-
self.assertEqual(result[0]["id"], "1") # person detection
|
|
396
|
-
|
|
397
|
-
def test_privacy_mask(self):
|
|
398
|
-
"""Test that detections in privacy mask are filtered out."""
|
|
399
|
-
result = are_detections_valid(
|
|
400
|
-
[self.person_detection_in_privacy],
|
|
401
|
-
[self.privacy_mask, self.include_contain_zone],
|
|
402
|
-
self.activity_settings,
|
|
403
|
-
)
|
|
404
|
-
self.assertEqual(result, [])
|
|
405
|
-
|
|
406
|
-
def test_include_contain(self):
|
|
407
|
-
"""Test that detections contained in include+contain zone are valid."""
|
|
408
|
-
result = are_detections_valid(
|
|
409
|
-
[self.person_detection_in_include], [self.include_contain_zone], self.activity_settings
|
|
410
|
-
)
|
|
411
|
-
self.assertEqual(len(result), 1)
|
|
412
|
-
self.assertEqual(result[0]["id"], "1")
|
|
413
|
-
|
|
414
|
-
def test_include_intersect(self):
|
|
415
|
-
"""Test that detections intersecting with include+intersect zone are valid."""
|
|
416
|
-
result = are_detections_valid(
|
|
417
|
-
[self.animal_detection_near_include], [self.include_intersect_zone], self.activity_settings
|
|
418
|
-
)
|
|
419
|
-
self.assertEqual(len(result), 1)
|
|
420
|
-
self.assertEqual(result[0]["id"], "2")
|
|
421
|
-
|
|
422
|
-
def test_exclude_contain(self):
|
|
423
|
-
"""Test that detections contained in exclude+contain zone are filtered out."""
|
|
424
|
-
result = are_detections_valid(
|
|
425
|
-
[self.vehicle_detection_in_exclude],
|
|
426
|
-
[self.exclude_contain_zone, self.include_contain_zone],
|
|
427
|
-
self.activity_settings,
|
|
428
|
-
)
|
|
429
|
-
self.assertEqual(result, [])
|
|
430
|
-
|
|
431
|
-
def test_exclude_intersect(self):
|
|
432
|
-
"""Test that detections intersecting with exclude+intersect zone are filtered out."""
|
|
433
|
-
result = are_detections_valid(
|
|
434
|
-
[self.motion_detection_near_exclude],
|
|
435
|
-
[self.exclude_intersect_zone, self.include_intersect_zone],
|
|
436
|
-
self.activity_settings,
|
|
437
|
-
)
|
|
438
|
-
self.assertEqual(result, [])
|
|
439
|
-
|
|
440
|
-
def test_no_include_zones(self):
|
|
441
|
-
"""Test behavior when there are no include zones."""
|
|
442
|
-
# With only exclude zones, valid classes should still be checked
|
|
443
|
-
result = are_detections_valid(
|
|
444
|
-
[self.other_detection_high_confidence, self.person_detection_in_include],
|
|
445
|
-
[self.exclude_contain_zone], # Only exclude zone with person/vehicle classes
|
|
446
|
-
self.activity_settings,
|
|
447
|
-
)
|
|
448
|
-
|
|
449
|
-
# Only person should be valid (in valid classes but not in exclude zone)
|
|
450
|
-
# "other" should be invalid because it's not in valid classes
|
|
451
|
-
self.assertEqual(len(result), 1)
|
|
452
|
-
self.assertEqual(result[0]["id"], "1")
|
|
453
|
-
|
|
454
|
-
def test_mixed_scenario(self):
|
|
455
|
-
"""Test a complex scenario with multiple zones and detections."""
|
|
456
|
-
zones = [
|
|
457
|
-
self.include_contain_zone,
|
|
458
|
-
self.include_intersect_zone,
|
|
459
|
-
self.exclude_contain_zone,
|
|
460
|
-
self.exclude_intersect_zone,
|
|
461
|
-
self.privacy_mask,
|
|
462
|
-
]
|
|
463
|
-
|
|
464
|
-
detections = [
|
|
465
|
-
self.person_detection_in_include, # Valid: in include zone
|
|
466
|
-
self.animal_detection_near_include, # Valid: intersects with include
|
|
467
|
-
self.vehicle_detection_in_exclude, # Invalid: in exclude zone
|
|
468
|
-
self.motion_detection_near_exclude, # Invalid: intersects with exclude
|
|
469
|
-
self.person_detection_in_privacy, # Invalid: in privacy mask
|
|
470
|
-
self.other_detection_high_confidence, # Invalid: not in valid classes
|
|
471
|
-
self.other_detection_low_confidence, # Invalid: below confidence threshold
|
|
472
|
-
]
|
|
473
|
-
|
|
474
|
-
result = are_detections_valid(detections, zones, self.activity_settings)
|
|
475
|
-
|
|
476
|
-
# Only person in include and animal near include should be valid
|
|
477
|
-
self.assertEqual(len(result), 2)
|
|
478
|
-
ids = [d["id"] for d in result]
|
|
479
|
-
self.assertIn("1", ids) # person in include
|
|
480
|
-
self.assertIn("2", ids) # animal near include
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
if __name__ == "__main__":
|
|
484
|
-
unittest.main()
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
from typing import Callable, TypeVar, Union
|
|
2
|
-
|
|
3
|
-
from _camera_ui_tools.camera_ui_types import (
|
|
4
|
-
AudioSetEvent,
|
|
5
|
-
AudioState,
|
|
6
|
-
BatterySetEvent,
|
|
7
|
-
BatteryState,
|
|
8
|
-
DoorbellSetEvent,
|
|
9
|
-
DoorbellState,
|
|
10
|
-
FrameData,
|
|
11
|
-
FrameMetadata,
|
|
12
|
-
LightSetEvent,
|
|
13
|
-
LightState,
|
|
14
|
-
MotionSetEvent,
|
|
15
|
-
MotionState,
|
|
16
|
-
ObjectSetEvent,
|
|
17
|
-
ObjectState,
|
|
18
|
-
SirenSetEvent,
|
|
19
|
-
SirenState,
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class FrameState(MotionState):
|
|
24
|
-
frameData: "FrameData"
|
|
25
|
-
metadata: "FrameMetadata"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
SetValue = Union[
|
|
29
|
-
LightSetEvent,
|
|
30
|
-
MotionSetEvent,
|
|
31
|
-
AudioSetEvent,
|
|
32
|
-
DoorbellSetEvent,
|
|
33
|
-
SirenSetEvent,
|
|
34
|
-
BatterySetEvent,
|
|
35
|
-
ObjectSetEvent,
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
T = TypeVar(
|
|
40
|
-
"T",
|
|
41
|
-
LightState,
|
|
42
|
-
MotionState,
|
|
43
|
-
AudioState,
|
|
44
|
-
DoorbellState,
|
|
45
|
-
SirenState,
|
|
46
|
-
ObjectState,
|
|
47
|
-
BatteryState,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
OnChangeCallback = Callable[[T, T], None]
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
from typing import Literal, Optional
|
|
2
|
-
|
|
3
|
-
from PIL import Image
|
|
4
|
-
|
|
5
|
-
from _camera_ui_tools.camera_ui_rpc_client import ClientInstance
|
|
6
|
-
from _camera_ui_tools.camera_ui_types import (
|
|
7
|
-
DecoderFormat,
|
|
8
|
-
FrameBuffer,
|
|
9
|
-
FrameData,
|
|
10
|
-
FrameImage,
|
|
11
|
-
FrameMetadata,
|
|
12
|
-
ImageInformation,
|
|
13
|
-
ImageOptions,
|
|
14
|
-
MotionSetEvent,
|
|
15
|
-
)
|
|
16
|
-
from _camera_ui_tools.camera_ui_types import (
|
|
17
|
-
VideoFrame as VideoFrameInterface,
|
|
18
|
-
)
|
|
19
|
-
from decoder.python.typings import FrameWorkerInterface
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class VideoFrame(VideoFrameInterface):
|
|
23
|
-
def __init__(
|
|
24
|
-
self,
|
|
25
|
-
frame_data: FrameData,
|
|
26
|
-
subject: str,
|
|
27
|
-
proxy: ClientInstance,
|
|
28
|
-
motion: Optional[MotionSetEvent] = None,
|
|
29
|
-
):
|
|
30
|
-
self.__data = frame_data["data"]
|
|
31
|
-
self.__metadata = frame_data["metadata"]
|
|
32
|
-
self.__info = frame_data["info"]
|
|
33
|
-
self.__timestamp = frame_data["timestamp"]
|
|
34
|
-
self.__motion = motion
|
|
35
|
-
|
|
36
|
-
self.__subject = subject
|
|
37
|
-
self.__proxy = proxy
|
|
38
|
-
|
|
39
|
-
@property
|
|
40
|
-
def data(self) -> bytes:
|
|
41
|
-
return self.__data
|
|
42
|
-
|
|
43
|
-
@property
|
|
44
|
-
def metadata(self) -> FrameMetadata:
|
|
45
|
-
return self.__metadata
|
|
46
|
-
|
|
47
|
-
@property
|
|
48
|
-
def info(self) -> ImageInformation:
|
|
49
|
-
return self.__info
|
|
50
|
-
|
|
51
|
-
@property
|
|
52
|
-
def timestamp(self) -> int:
|
|
53
|
-
return self.__timestamp
|
|
54
|
-
|
|
55
|
-
@property
|
|
56
|
-
def motion(self) -> Optional[MotionSetEvent]:
|
|
57
|
-
return self.__motion
|
|
58
|
-
|
|
59
|
-
@property
|
|
60
|
-
def input_width(self) -> int:
|
|
61
|
-
return self.__metadata["width"]
|
|
62
|
-
|
|
63
|
-
@property
|
|
64
|
-
def input_height(self) -> int:
|
|
65
|
-
return self.__metadata["height"]
|
|
66
|
-
|
|
67
|
-
@property
|
|
68
|
-
def input_format(self) -> DecoderFormat:
|
|
69
|
-
return self.__metadata["format"]
|
|
70
|
-
|
|
71
|
-
async def to_buffer(self, options: Optional[ImageOptions] = None) -> FrameBuffer:
|
|
72
|
-
processed_frame: FrameBuffer = {
|
|
73
|
-
"image": self.data,
|
|
74
|
-
"info": self.info,
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if options and len(options) > 0:
|
|
78
|
-
options = self.__validate_options("buffer", options or {})
|
|
79
|
-
frame_worker_proxy = await self.__frame_worker_proxy()
|
|
80
|
-
processed_frame = await frame_worker_proxy.processFrame(
|
|
81
|
-
self.data,
|
|
82
|
-
self.input_width,
|
|
83
|
-
self.input_height,
|
|
84
|
-
self.input_format,
|
|
85
|
-
options,
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
"image": processed_frame["image"],
|
|
90
|
-
"info": processed_frame["info"],
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async def to_image(self, options: Optional[ImageOptions] = None) -> FrameImage:
|
|
94
|
-
processed_frame: FrameBuffer = {
|
|
95
|
-
"image": self.data,
|
|
96
|
-
"info": self.info,
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if options and len(options) > 0:
|
|
100
|
-
options = self.__validate_options("image", options or {})
|
|
101
|
-
frame_worker_proxy = await self.__frame_worker_proxy()
|
|
102
|
-
processed_frame = await frame_worker_proxy.processFrame(
|
|
103
|
-
self.data,
|
|
104
|
-
self.input_width,
|
|
105
|
-
self.input_height,
|
|
106
|
-
self.input_format,
|
|
107
|
-
options,
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
mode = (
|
|
111
|
-
"RGBA"
|
|
112
|
-
if processed_frame["info"]["channels"] == 4
|
|
113
|
-
else "L"
|
|
114
|
-
if processed_frame["info"]["channels"] == 1
|
|
115
|
-
else "RGB"
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
return {
|
|
119
|
-
"image": Image.frombytes(
|
|
120
|
-
mode,
|
|
121
|
-
(processed_frame["info"]["width"], processed_frame["info"]["height"]),
|
|
122
|
-
processed_frame["image"],
|
|
123
|
-
),
|
|
124
|
-
"info": processed_frame["info"],
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async def save(self, path: str, options: Optional[ImageOptions] = None) -> None:
|
|
128
|
-
image = await self.to_image(options or {})
|
|
129
|
-
image["image"].save(path)
|
|
130
|
-
image["image"].close()
|
|
131
|
-
|
|
132
|
-
async def __frame_worker_proxy(self) -> FrameWorkerInterface:
|
|
133
|
-
return await self.__proxy.create_rpc_proxy(FrameWorkerInterface, self.__subject)
|
|
134
|
-
|
|
135
|
-
def __validate_options(
|
|
136
|
-
self,
|
|
137
|
-
target: Literal["buffer", "image"],
|
|
138
|
-
options: ImageOptions = {},
|
|
139
|
-
) -> ImageOptions:
|
|
140
|
-
if "format" not in options and target == "image":
|
|
141
|
-
options["format"] = {"to": "rgb"}
|
|
142
|
-
|
|
143
|
-
return options
|