@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,196 +0,0 @@
|
|
|
1
|
-
from typing import Any, Literal, Union
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from PIL import Image
|
|
5
|
-
|
|
6
|
-
from _camera_ui_tools.camera_ui_common import to_thread
|
|
7
|
-
from _camera_ui_tools.camera_ui_types import (
|
|
8
|
-
DecoderFormat,
|
|
9
|
-
ImageCrop,
|
|
10
|
-
ImageFormat,
|
|
11
|
-
ImageOptions,
|
|
12
|
-
ImageResize,
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
_YUV2RGB_MATRIX = np.array([[1.0, 0.0, 1.402], [1.0, -0.344136, -0.714136], [1.0, 1.772, 0.0]]).T
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
async def process_image_threaded(
|
|
19
|
-
image_data: bytes,
|
|
20
|
-
input_width: int,
|
|
21
|
-
input_height: int,
|
|
22
|
-
input_format: Union[DecoderFormat, Literal["rgba"], Literal["gray"]],
|
|
23
|
-
options: ImageOptions,
|
|
24
|
-
) -> bytes:
|
|
25
|
-
return await to_thread(
|
|
26
|
-
lambda: process_image(image_data, input_width, input_height, input_format, options)
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def process_image(
|
|
31
|
-
image_data: bytes,
|
|
32
|
-
input_width: int,
|
|
33
|
-
input_height: int,
|
|
34
|
-
input_format: Union[DecoderFormat, Literal["rgba"], Literal["gray"]],
|
|
35
|
-
options: ImageOptions,
|
|
36
|
-
) -> bytes:
|
|
37
|
-
image: Union[Image.Image, None] = None
|
|
38
|
-
|
|
39
|
-
crop = options.get("crop", None)
|
|
40
|
-
resize = options.get("resize", None)
|
|
41
|
-
format = options.get("format", None)
|
|
42
|
-
|
|
43
|
-
if format and format["to"] == "gray":
|
|
44
|
-
if input_format == "yuv420p":
|
|
45
|
-
gray = yuv420_to_gray(image_data, input_width, input_height)
|
|
46
|
-
image = Image.fromarray(gray)
|
|
47
|
-
elif input_format == "nv12":
|
|
48
|
-
gray = nv12_to_gray(image_data, input_width, input_height)
|
|
49
|
-
image = Image.fromarray(gray)
|
|
50
|
-
elif input_format == "rgb24":
|
|
51
|
-
image = Image.frombytes("RGB", (input_width, input_height), image_data).convert("L")
|
|
52
|
-
elif input_format == "rgba":
|
|
53
|
-
image = Image.frombytes("RGBA", (input_width, input_height), image_data).convert("L")
|
|
54
|
-
else:
|
|
55
|
-
image = Image.frombytes("L", (input_width, input_height), image_data)
|
|
56
|
-
|
|
57
|
-
format = None
|
|
58
|
-
elif format and format["to"] == "rgba":
|
|
59
|
-
if input_format == "yuv420p":
|
|
60
|
-
rgba = yuv420_to_rgba(image_data, input_width, input_height)
|
|
61
|
-
image = Image.fromarray(rgba)
|
|
62
|
-
elif input_format == "nv12":
|
|
63
|
-
rgba = nv12_to_rgba(image_data, input_width, input_height)
|
|
64
|
-
image = Image.fromarray(rgba)
|
|
65
|
-
elif input_format == "rgb24":
|
|
66
|
-
image = Image.frombytes("RGB", (input_width, input_height), image_data).convert("RGBA")
|
|
67
|
-
elif input_format == "gray":
|
|
68
|
-
image = Image.frombytes("L", (input_width, input_height), image_data).convert("RGBA")
|
|
69
|
-
else:
|
|
70
|
-
image = Image.frombytes("RGBA", (input_width, input_height), image_data)
|
|
71
|
-
|
|
72
|
-
format = None
|
|
73
|
-
else:
|
|
74
|
-
if input_format == "yuv420p":
|
|
75
|
-
rgb = yuv420_to_rgb(image_data, input_width, input_height)
|
|
76
|
-
image = Image.fromarray(rgb)
|
|
77
|
-
elif input_format == "nv12":
|
|
78
|
-
rgb = nv12_to_rgb(image_data, input_width, input_height)
|
|
79
|
-
image = Image.fromarray(rgb)
|
|
80
|
-
elif input_format == "rgb24":
|
|
81
|
-
image = Image.frombytes("RGB", (input_width, input_height), image_data)
|
|
82
|
-
elif input_format == "gray":
|
|
83
|
-
image = Image.frombytes("L", (input_width, input_height), image_data)
|
|
84
|
-
else:
|
|
85
|
-
image = Image.frombytes("RGBA", (input_width, input_height), image_data)
|
|
86
|
-
|
|
87
|
-
if crop:
|
|
88
|
-
image = crop_image(image, crop)
|
|
89
|
-
input_width = crop["width"]
|
|
90
|
-
input_height = crop["height"]
|
|
91
|
-
|
|
92
|
-
if resize:
|
|
93
|
-
image = resize_image(image, input_width, input_height, resize)
|
|
94
|
-
input_width = resize["width"]
|
|
95
|
-
input_height = resize["height"]
|
|
96
|
-
|
|
97
|
-
if format:
|
|
98
|
-
image = format_image(image, format)
|
|
99
|
-
|
|
100
|
-
return image.tobytes()
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
def crop_image(image: Image.Image, crop: ImageCrop) -> Image.Image:
|
|
104
|
-
crop_box = (
|
|
105
|
-
int(crop["left"]),
|
|
106
|
-
int(crop["top"]),
|
|
107
|
-
int(crop["left"] + crop["width"]),
|
|
108
|
-
int(crop["top"] + crop["height"]),
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
return image.crop(crop_box)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
def resize_image(image: Image.Image, input_width: int, input_height: int, resize: ImageResize) -> Image.Image:
|
|
115
|
-
width = resize["width"]
|
|
116
|
-
height = resize["height"]
|
|
117
|
-
|
|
118
|
-
if width and height and (width != input_width or height != input_height):
|
|
119
|
-
image = image.resize((int(width), int(height)), resample=Image.Resampling.BILINEAR)
|
|
120
|
-
|
|
121
|
-
return image
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
def format_image(image: Image.Image, format: ImageFormat) -> Image.Image:
|
|
125
|
-
if format["to"] == "rgba":
|
|
126
|
-
image = image.convert("RGBA")
|
|
127
|
-
elif format["to"] == "gray":
|
|
128
|
-
image = image.convert("L")
|
|
129
|
-
|
|
130
|
-
return image
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
def yuv420_to_rgb(yuv_bytes: bytes, width: int, height: int) -> np.ndarray[Any, Any]:
|
|
134
|
-
frame_size = width * height
|
|
135
|
-
uv_size = frame_size // 4
|
|
136
|
-
|
|
137
|
-
raw_data = np.frombuffer(yuv_bytes, dtype=np.uint8)
|
|
138
|
-
|
|
139
|
-
y = raw_data[:frame_size].reshape((height, width)).astype(np.float32) - 16.0
|
|
140
|
-
u = (
|
|
141
|
-
raw_data[frame_size : frame_size + uv_size].reshape((height // 2, width // 2)).astype(np.float32)
|
|
142
|
-
- 128.0
|
|
143
|
-
)
|
|
144
|
-
v = raw_data[frame_size + uv_size :].reshape((height // 2, width // 2)).astype(np.float32) - 128.0
|
|
145
|
-
|
|
146
|
-
u = u.repeat(2, axis=0).repeat(2, axis=1)
|
|
147
|
-
v = v.repeat(2, axis=0).repeat(2, axis=1)
|
|
148
|
-
|
|
149
|
-
r = y + 1.402 * v
|
|
150
|
-
g = y - 0.344136 * u - 0.714136 * v
|
|
151
|
-
b = y + 1.772 * u
|
|
152
|
-
|
|
153
|
-
rgb = np.stack((r, g, b), axis=-1)
|
|
154
|
-
return np.clip(rgb, 0, 255).astype(np.uint8)
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
def yuv420_to_rgba(yuv_bytes: bytes, width: int, height: int) -> np.ndarray[Any, Any]:
|
|
158
|
-
rgb = yuv420_to_rgb(yuv_bytes, width, height)
|
|
159
|
-
alpha = np.full((height, width, 1), 255, dtype=np.uint8)
|
|
160
|
-
rgba = np.concatenate((rgb, alpha), axis=-1)
|
|
161
|
-
return rgba
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
def yuv420_to_gray(yuv_bytes: bytes, width: int, height: int) -> np.ndarray[Any, Any]:
|
|
165
|
-
frame_size = width * height
|
|
166
|
-
raw_data = np.frombuffer(yuv_bytes, dtype=np.uint8)
|
|
167
|
-
return raw_data[:frame_size].reshape((height, width)).astype(np.uint8)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
def nv12_to_gray(nv12_bytes: bytes, width: int, height: int) -> np.ndarray[Any, Any]:
|
|
171
|
-
frame_size = width * height
|
|
172
|
-
raw_data = np.frombuffer(nv12_bytes, dtype=np.uint8)
|
|
173
|
-
return raw_data[:frame_size].reshape((height, width))
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
def nv12_to_rgb(nv12_bytes: bytes, width: int, height: int) -> np.ndarray[Any, Any]:
|
|
177
|
-
frame_size = width * height
|
|
178
|
-
|
|
179
|
-
raw_data = np.frombuffer(nv12_bytes, dtype=np.uint8)
|
|
180
|
-
y = raw_data[:frame_size].reshape((height, width)).astype(np.float32) - 16.0
|
|
181
|
-
uv_plane = raw_data[frame_size:].reshape((height // 2, width)).astype(np.float32) - 128.0
|
|
182
|
-
|
|
183
|
-
u = uv_plane[:, 0::2].repeat(2, axis=0).repeat(2, axis=1)
|
|
184
|
-
v = uv_plane[:, 1::2].repeat(2, axis=0).repeat(2, axis=1)
|
|
185
|
-
|
|
186
|
-
yuv = np.stack((y, u, v), axis=-1)
|
|
187
|
-
|
|
188
|
-
rgb = np.dot(yuv, _YUV2RGB_MATRIX)
|
|
189
|
-
|
|
190
|
-
return np.clip(rgb, 0, 255).astype(np.uint8)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
def nv12_to_rgba(nv12_bytes: bytes, width: int, height: int) -> np.ndarray[Any, Any]:
|
|
194
|
-
rgb = nv12_to_rgb(nv12_bytes, width, height)
|
|
195
|
-
alpha = np.full((height, width, 1), 255, dtype=np.uint8)
|
|
196
|
-
return np.concatenate((rgb, alpha), axis=-1)
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import weakref
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class FramePool:
|
|
5
|
-
def __init__(self, frame_size: int, max_pool_size: int = 4):
|
|
6
|
-
self._frame_size = frame_size
|
|
7
|
-
self._max_pool_size = max_pool_size
|
|
8
|
-
self._pool: list[memoryview] = []
|
|
9
|
-
self._in_use: dict[int, weakref.ref[memoryview]] = {}
|
|
10
|
-
|
|
11
|
-
# Initial pool filling
|
|
12
|
-
for _ in range(max_pool_size):
|
|
13
|
-
self._pool.append(memoryview(bytearray(frame_size)))
|
|
14
|
-
|
|
15
|
-
def get(self) -> memoryview:
|
|
16
|
-
self._cleanup_expired_refs()
|
|
17
|
-
frame = self._pool.pop() if self._pool else memoryview(bytearray(self._frame_size))
|
|
18
|
-
frame_id = id(frame)
|
|
19
|
-
|
|
20
|
-
def callback(ref: weakref.ref[memoryview]) -> None:
|
|
21
|
-
return self._on_frame_collected(frame_id)
|
|
22
|
-
|
|
23
|
-
self._in_use[frame_id] = weakref.ref(frame, callback)
|
|
24
|
-
|
|
25
|
-
return frame
|
|
26
|
-
|
|
27
|
-
def release(self, frame: memoryview) -> None:
|
|
28
|
-
if frame.nbytes != self._frame_size:
|
|
29
|
-
return # Ignore invalid frames
|
|
30
|
-
|
|
31
|
-
frame_id = id(frame)
|
|
32
|
-
if frame_id in self._in_use:
|
|
33
|
-
del self._in_use[frame_id]
|
|
34
|
-
|
|
35
|
-
if len(self._pool) < self._max_pool_size:
|
|
36
|
-
self._pool.append(frame)
|
|
37
|
-
|
|
38
|
-
def _cleanup_expired_refs(self) -> None:
|
|
39
|
-
expired = [frame_id for frame_id, ref in self._in_use.items() if ref() is None]
|
|
40
|
-
for frame_id in expired:
|
|
41
|
-
del self._in_use[frame_id]
|
|
42
|
-
|
|
43
|
-
def _on_frame_collected(self, frame_id: int) -> None:
|
|
44
|
-
if frame_id in self._in_use:
|
|
45
|
-
del self._in_use[frame_id]
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
def __get_optimal_work_group_size1():
|
|
2
|
-
width = 640
|
|
3
|
-
height = 360
|
|
4
|
-
|
|
5
|
-
max_work_group_size = 256
|
|
6
|
-
compute_units = 8
|
|
7
|
-
|
|
8
|
-
optimal_group_count = compute_units * 4
|
|
9
|
-
|
|
10
|
-
for size in [32, 16, 8, 4]:
|
|
11
|
-
work_groups_per_dimension = (width // size) * (height // size)
|
|
12
|
-
if (
|
|
13
|
-
width % size == 0
|
|
14
|
-
and height % size == 0
|
|
15
|
-
and size * size <= max_work_group_size
|
|
16
|
-
and work_groups_per_dimension >= optimal_group_count
|
|
17
|
-
):
|
|
18
|
-
return (size, size)
|
|
19
|
-
|
|
20
|
-
return (min(max_work_group_size, width), 1)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def get_optimal_work_group_size2():
|
|
24
|
-
width = 640
|
|
25
|
-
height = 360
|
|
26
|
-
|
|
27
|
-
max_work_group_size = 256
|
|
28
|
-
compute_units = 8
|
|
29
|
-
|
|
30
|
-
# Prüfe zunächst auf quadratische Größen, die Potenzen von zwei sind
|
|
31
|
-
for size in [32, 16, 8, 4]:
|
|
32
|
-
if width % size == 0 and height % size == 0 and size * size <= max_work_group_size:
|
|
33
|
-
return (size, size)
|
|
34
|
-
|
|
35
|
-
# Wenn keine geeignete quadratische Größe gefunden wurde, suche nach der besten rechteckigen Größe
|
|
36
|
-
for size in range(min(max_work_group_size, width), 0, -1):
|
|
37
|
-
if width % size == 0:
|
|
38
|
-
return (size, 1)
|
|
39
|
-
|
|
40
|
-
# Wenn keine passende Workgroup-Größe gefunden wurde, Fallback auf eine sehr kleine Größe
|
|
41
|
-
return (1, 1)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def get_optimal_work_group_size3():
|
|
45
|
-
width = 640
|
|
46
|
-
height = 360
|
|
47
|
-
|
|
48
|
-
max_work_group_size = 256
|
|
49
|
-
compute_units = 8
|
|
50
|
-
|
|
51
|
-
# Priorisiere größere Workgroup-Größen, um die GPU-Auslastung zu maximieren
|
|
52
|
-
for size in [16, 8, 4]:
|
|
53
|
-
if width % size == 0 and height % size == 0 and size * size <= max_work_group_size:
|
|
54
|
-
return (size, size)
|
|
55
|
-
|
|
56
|
-
# Fallback auf eine kleinere rechteckige Workgroup-Größe, falls notwendig
|
|
57
|
-
return (min(max_work_group_size, width), 1)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
print(__get_optimal_work_group_size1())
|
|
61
|
-
print(get_optimal_work_group_size2())
|
|
62
|
-
print(get_optimal_work_group_size3())
|
|
Binary file
|
|
Binary file
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
|
|
2
|
-
|
|
3
|
-
__kernel void process_frame(
|
|
4
|
-
__read_only image2d_t input,
|
|
5
|
-
__global float *background_model,
|
|
6
|
-
__global float *temp_buffer,
|
|
7
|
-
__write_only image2d_t output,
|
|
8
|
-
__constant float *kernel_values,
|
|
9
|
-
int kernel_size,
|
|
10
|
-
int width,
|
|
11
|
-
int height,
|
|
12
|
-
float alpha,
|
|
13
|
-
float threshold,
|
|
14
|
-
int dilation_size,
|
|
15
|
-
int first_frame
|
|
16
|
-
) {
|
|
17
|
-
int x = get_global_id(0);
|
|
18
|
-
int y = get_global_id(1);
|
|
19
|
-
if (x >= width || y >= height) return;
|
|
20
|
-
int idx = y * width + x;
|
|
21
|
-
|
|
22
|
-
// Gaussian blur
|
|
23
|
-
int radius = (kernel_size - 1) / 2;
|
|
24
|
-
float blurred_value = 0.0f;
|
|
25
|
-
for (int i = -radius; i <= radius; i++) {
|
|
26
|
-
for (int j = -radius; j <= radius; j++) {
|
|
27
|
-
int2 samplePos = (int2)(clamp(x + i, 0, width - 1), clamp(y + j, 0, height - 1));
|
|
28
|
-
float4 pixel = read_imagef(input, sampler, samplePos);
|
|
29
|
-
float weight = kernel_values[i + radius] * kernel_values[j + radius];
|
|
30
|
-
blurred_value += pixel.x * weight;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Store blurred value in temp buffer
|
|
35
|
-
temp_buffer[idx] = blurred_value;
|
|
36
|
-
|
|
37
|
-
if (first_frame) {
|
|
38
|
-
// Initialize background model
|
|
39
|
-
background_model[idx] = blurred_value;
|
|
40
|
-
write_imagef(output, (int2)(x, y), (float4)(0.0f, 0.0f, 0.0f, 1.0f));
|
|
41
|
-
} else {
|
|
42
|
-
// Background subtraction
|
|
43
|
-
float bg_pixel = background_model[idx];
|
|
44
|
-
|
|
45
|
-
// Update background model
|
|
46
|
-
float updated_bg = bg_pixel * (1.0f - alpha) + blurred_value * alpha;
|
|
47
|
-
background_model[idx] = updated_bg;
|
|
48
|
-
|
|
49
|
-
// Compute difference and threshold
|
|
50
|
-
float diff = fabs(blurred_value - bg_pixel);
|
|
51
|
-
float mask_value = (diff > threshold) ? 1.0f : 0.0f;
|
|
52
|
-
|
|
53
|
-
// Dilation
|
|
54
|
-
float maxValue = mask_value;
|
|
55
|
-
for (int dy = -dilation_size; dy <= dilation_size; dy++) {
|
|
56
|
-
int sy = clamp(y + dy, 0, height - 1);
|
|
57
|
-
for (int dx = -dilation_size; dx <= dilation_size; dx++) {
|
|
58
|
-
int sx = clamp(x + dx, 0, width - 1);
|
|
59
|
-
int neighbor_idx = sy * width + sx;
|
|
60
|
-
float neighbor_pixel = background_model[neighbor_idx];
|
|
61
|
-
float neighbor_blurred = temp_buffer[neighbor_idx];
|
|
62
|
-
float neighbor_diff = fabs(neighbor_blurred - neighbor_pixel);
|
|
63
|
-
float neighbor_mask = (neighbor_diff > threshold) ? 1.0f : 0.0f;
|
|
64
|
-
maxValue = fmax(maxValue, neighbor_mask);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
write_imagef(output, (int2)(x, y), (float4)(maxValue, maxValue, maxValue, 1.0f));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
|
|
2
|
-
|
|
3
|
-
__kernel void gaussian_blur_combined(
|
|
4
|
-
__read_only image2d_t input,
|
|
5
|
-
__write_only image2d_t output,
|
|
6
|
-
__constant float *kernel_values,
|
|
7
|
-
int kernel_size
|
|
8
|
-
) {
|
|
9
|
-
int x = get_global_id(0);
|
|
10
|
-
int y = get_global_id(1);
|
|
11
|
-
int width = get_image_width(input);
|
|
12
|
-
int height = get_image_height(input);
|
|
13
|
-
|
|
14
|
-
if (x >= width || y >= height) return;
|
|
15
|
-
|
|
16
|
-
int radius = (kernel_size - 1) / 2;
|
|
17
|
-
float sum = 0.0f;
|
|
18
|
-
|
|
19
|
-
// Kombinierter horizontaler und vertikaler Blur
|
|
20
|
-
for (int i = -radius; i <= radius; i++) {
|
|
21
|
-
for (int j = -radius; j <= radius; j++) {
|
|
22
|
-
int2 samplePos = (int2)(clamp(x + i, 0, width - 1), clamp(y + j, 0, height - 1));
|
|
23
|
-
float4 pixel = read_imagef(input, sampler, samplePos);
|
|
24
|
-
float weight = kernel_values[i + radius] * kernel_values[j + radius];
|
|
25
|
-
sum += pixel.x * weight;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
write_imagef(output, (int2)(x, y), (float4)(sum, 0.0f, 0.0f, 1.0f));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
__kernel void gaussian_blur_horizontal(
|
|
33
|
-
__read_only image2d_t input,
|
|
34
|
-
__write_only image2d_t output,
|
|
35
|
-
__global float *kernel_values,
|
|
36
|
-
int kernel_size
|
|
37
|
-
) {
|
|
38
|
-
int x = get_global_id(0);
|
|
39
|
-
int y = get_global_id(1);
|
|
40
|
-
|
|
41
|
-
int width = get_image_width(input);
|
|
42
|
-
int radius = (kernel_size - 1) / 2;
|
|
43
|
-
|
|
44
|
-
if (x >= width) return;
|
|
45
|
-
|
|
46
|
-
float sum = 0.0f;
|
|
47
|
-
for (int k = -radius; k <= radius; k++) {
|
|
48
|
-
int sx = clamp(x + k, 0, width - 1);
|
|
49
|
-
float4 pixel = read_imagef(input, sampler, (int2)(sx, y));
|
|
50
|
-
float weight = kernel_values[k + radius];
|
|
51
|
-
sum += pixel.x * weight;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
write_imagef(output, (int2)(x, y), (float4)(sum, 0.0f, 0.0f, 1.0f));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
__kernel void gaussian_blur_vertical(
|
|
58
|
-
__read_only image2d_t input,
|
|
59
|
-
__write_only image2d_t output,
|
|
60
|
-
__global float *kernel_values,
|
|
61
|
-
int kernel_size
|
|
62
|
-
) {
|
|
63
|
-
int x = get_global_id(0);
|
|
64
|
-
int y = get_global_id(1);
|
|
65
|
-
|
|
66
|
-
int height = get_image_height(input);
|
|
67
|
-
int radius = (kernel_size - 1) / 2;
|
|
68
|
-
|
|
69
|
-
if (y >= height) return;
|
|
70
|
-
|
|
71
|
-
float sum = 0.0f;
|
|
72
|
-
for (int k = -radius; k <= radius; k++) {
|
|
73
|
-
int sy = clamp(y + k, 0, height - 1);
|
|
74
|
-
float4 pixel = read_imagef(input, sampler, (int2)(x, sy));
|
|
75
|
-
float weight = kernel_values[k + radius];
|
|
76
|
-
sum += pixel.x * weight;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
write_imagef(output, (int2)(x, y), (float4)(sum, 0.0f, 0.0f, 1.0f));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
__kernel void background_subtraction(
|
|
83
|
-
__read_only image2d_t current_frame,
|
|
84
|
-
__global float *background_model,
|
|
85
|
-
__write_only image2d_t mask,
|
|
86
|
-
int width,
|
|
87
|
-
int height,
|
|
88
|
-
float alpha,
|
|
89
|
-
float threshold
|
|
90
|
-
) {
|
|
91
|
-
int x = get_global_id(0);
|
|
92
|
-
int y = get_global_id(1);
|
|
93
|
-
if (x >= width || y >= height) return;
|
|
94
|
-
int idx = y * width + x;
|
|
95
|
-
|
|
96
|
-
float current_pixel = read_imagef(current_frame, sampler, (int2)(x, y)).x;
|
|
97
|
-
float bg_pixel = background_model[idx];
|
|
98
|
-
|
|
99
|
-
// Aktualisiere Hintergrundmodell
|
|
100
|
-
float updated_bg = bg_pixel * (1.0f - alpha) + current_pixel * alpha;
|
|
101
|
-
background_model[idx] = updated_bg;
|
|
102
|
-
|
|
103
|
-
// Berechne Differenz
|
|
104
|
-
float diff = fabs(current_pixel - bg_pixel);
|
|
105
|
-
float result = (diff > threshold) ? 1.0f : 0.0f;
|
|
106
|
-
write_imagef(mask, (int2)(x, y), (float4)(result, 0.0f, 0.0f, 1.0f));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
__kernel void dilate(
|
|
110
|
-
__read_only image2d_t input,
|
|
111
|
-
__write_only image2d_t output,
|
|
112
|
-
int size
|
|
113
|
-
) {
|
|
114
|
-
int x = get_global_id(0);
|
|
115
|
-
int y = get_global_id(1);
|
|
116
|
-
int width = get_image_width(input);
|
|
117
|
-
int height = get_image_height(input);
|
|
118
|
-
if (x >= width || y >= height) return;
|
|
119
|
-
|
|
120
|
-
float maxValue = 0.0f;
|
|
121
|
-
for (int dy = -size; dy <= size; dy++) {
|
|
122
|
-
int sy = clamp(y + dy, 0, height - 1);
|
|
123
|
-
for (int dx = -size; dx <= size; dx++) {
|
|
124
|
-
int sx = clamp(x + dx, 0, width - 1);
|
|
125
|
-
float pixel = read_imagef(input, sampler, (int2)(sx, sy)).x;
|
|
126
|
-
maxValue = fmax(maxValue, pixel);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
write_imagef(output, (int2)(x, y), (float4)(maxValue, 0.0f, 0.0f, 1.0f));
|
|
130
|
-
}
|