@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,427 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
from typing import Any, Optional
|
|
3
|
-
|
|
4
|
-
import cv2
|
|
5
|
-
import numpy as np
|
|
6
|
-
import pyopencl as cl
|
|
7
|
-
|
|
8
|
-
BLUR_RADIUS = 6
|
|
9
|
-
MOTION_THRESHOLD = 0.04
|
|
10
|
-
DILATION_SIZE = 6
|
|
11
|
-
AREA_THRESHOLD = 400
|
|
12
|
-
ALPHA = 0.2
|
|
13
|
-
|
|
14
|
-
video_path = "motion2.mp4"
|
|
15
|
-
image1_path = "test1_resized.jpg"
|
|
16
|
-
image2_path = "test2_resized.jpg"
|
|
17
|
-
fps = 10
|
|
18
|
-
num_frames = fps * 15
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class ProfilingInfo:
|
|
22
|
-
def __init__(self):
|
|
23
|
-
self.start_time = 0
|
|
24
|
-
self.end_time = 0
|
|
25
|
-
|
|
26
|
-
def get_execution_time(self):
|
|
27
|
-
return (self.end_time - self.start_time) * 1e-9 # Convert nanoseconds to seconds
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def profile_event(event: Any, name: Any):
|
|
31
|
-
event.wait()
|
|
32
|
-
profiling_info = ProfilingInfo()
|
|
33
|
-
profiling_info.start_time = event.get_profiling_info(cl.profiling_info.START)
|
|
34
|
-
profiling_info.end_time = event.get_profiling_info(cl.profiling_info.END)
|
|
35
|
-
print(f"{name} execution time: {profiling_info.get_execution_time():.6f} seconds")
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
from typing import Any, Tuple
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class OpenCLMotionDetector:
|
|
42
|
-
def __init__(self, width: int, height: int):
|
|
43
|
-
self.width = width
|
|
44
|
-
self.height = height
|
|
45
|
-
|
|
46
|
-
# OpenCL Setup
|
|
47
|
-
self.ctx, self.device = self.create_context()
|
|
48
|
-
self.queue: Any = cl.CommandQueue(self.ctx, properties=cl.command_queue_properties.PROFILING_ENABLE)
|
|
49
|
-
self.program = self.create_program(self.ctx, self.device, "opencl.cl")
|
|
50
|
-
|
|
51
|
-
mf: Any = cl.mem_flags
|
|
52
|
-
|
|
53
|
-
# Create reusable OpenCL images and buffers
|
|
54
|
-
self.input_image: Any = cl.Image(
|
|
55
|
-
self.ctx,
|
|
56
|
-
mf.READ_ONLY,
|
|
57
|
-
cl.ImageFormat(cl.channel_order.R, cl.channel_type.UNORM_INT8),
|
|
58
|
-
shape=(self.width, self.height),
|
|
59
|
-
)
|
|
60
|
-
self.result_image: Any = cl.Image(
|
|
61
|
-
self.ctx,
|
|
62
|
-
mf.WRITE_ONLY,
|
|
63
|
-
cl.ImageFormat(cl.channel_order.R, cl.channel_type.FLOAT),
|
|
64
|
-
shape=(self.width, self.height),
|
|
65
|
-
)
|
|
66
|
-
self.background_model_buf: Any = cl.Buffer(
|
|
67
|
-
self.ctx, mf.READ_WRITE, size=self.width * self.height * np.dtype(np.float32).itemsize
|
|
68
|
-
)
|
|
69
|
-
self.temp_buffer: Any = cl.Buffer(
|
|
70
|
-
self.ctx, mf.READ_WRITE, size=self.width * self.height * np.dtype(np.float32).itemsize
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
# Create host buffer for results
|
|
74
|
-
self.host_result_buffer = np.zeros((self.height, self.width), dtype=np.float32)
|
|
75
|
-
|
|
76
|
-
# Create Gaussian kernel and copy it to global GPU memory
|
|
77
|
-
self.kernel = self.create_gaussian_kernel(BLUR_RADIUS)
|
|
78
|
-
self.kernel_buf: Any = cl.Buffer(self.ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=self.kernel)
|
|
79
|
-
self.kernel_size = np.int32(len(self.kernel))
|
|
80
|
-
|
|
81
|
-
self.local_size = self.get_optimal_work_group_size()
|
|
82
|
-
print(f"Local size: {self.local_size}")
|
|
83
|
-
|
|
84
|
-
self.global_size = (
|
|
85
|
-
((self.width + self.local_size[0] - 1) // self.local_size[0]) * self.local_size[0],
|
|
86
|
-
((self.height + self.local_size[1] - 1) // self.local_size[1]) * self.local_size[1],
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
self.first_frame = True
|
|
90
|
-
|
|
91
|
-
@staticmethod
|
|
92
|
-
def create_context() -> Tuple[Any, Any]:
|
|
93
|
-
platforms: Any = cl.get_platforms()
|
|
94
|
-
if len(platforms) == 0:
|
|
95
|
-
raise RuntimeError("No OpenCL platforms found.")
|
|
96
|
-
|
|
97
|
-
devices = platforms[0].get_devices(cl.device_type.GPU)
|
|
98
|
-
if len(devices) == 0:
|
|
99
|
-
devices = platforms[0].get_devices(cl.device_type.CPU)
|
|
100
|
-
if len(devices) == 0:
|
|
101
|
-
raise RuntimeError("No OpenCL devices found.")
|
|
102
|
-
|
|
103
|
-
context: Any = cl.Context([devices[0]])
|
|
104
|
-
return context, devices[0]
|
|
105
|
-
|
|
106
|
-
@staticmethod
|
|
107
|
-
def create_program(context: Any, device: Any, filename: str) -> Any:
|
|
108
|
-
with open(filename) as file:
|
|
109
|
-
kernel_source = file.read()
|
|
110
|
-
program = cl.Program(context, kernel_source)
|
|
111
|
-
program.build(devices=[device])
|
|
112
|
-
return program
|
|
113
|
-
|
|
114
|
-
@staticmethod
|
|
115
|
-
def create_gaussian_kernel(radius: int) -> np.ndarray[Any, Any]:
|
|
116
|
-
sigma = radius / 3.0
|
|
117
|
-
x = np.arange(-radius, radius + 1)
|
|
118
|
-
kernel = np.exp(-(x**2) / (2 * sigma**2))
|
|
119
|
-
return (kernel / np.sum(kernel)).astype(np.float32)
|
|
120
|
-
|
|
121
|
-
def process_frame(
|
|
122
|
-
self,
|
|
123
|
-
gray_frame: np.ndarray[Any, Any],
|
|
124
|
-
motion_threshold: float,
|
|
125
|
-
dilation_size: int,
|
|
126
|
-
area_threshold: int,
|
|
127
|
-
alpha: float,
|
|
128
|
-
) -> tuple[Optional[np.ndarray[Any, Any]], list[tuple[float, float, float, float]]]:
|
|
129
|
-
# Copy the frame to OpenCL image
|
|
130
|
-
cl.enqueue_copy(
|
|
131
|
-
self.queue,
|
|
132
|
-
self.input_image,
|
|
133
|
-
gray_frame,
|
|
134
|
-
origin=(0, 0),
|
|
135
|
-
region=(self.width, self.height),
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
# Process frame
|
|
139
|
-
event = self.program.process_frame(
|
|
140
|
-
self.queue,
|
|
141
|
-
self.global_size,
|
|
142
|
-
self.local_size,
|
|
143
|
-
self.input_image,
|
|
144
|
-
self.background_model_buf,
|
|
145
|
-
self.temp_buffer,
|
|
146
|
-
self.result_image,
|
|
147
|
-
self.kernel_buf,
|
|
148
|
-
self.kernel_size,
|
|
149
|
-
np.int32(self.width),
|
|
150
|
-
np.int32(self.height),
|
|
151
|
-
np.float32(alpha),
|
|
152
|
-
np.float32(motion_threshold),
|
|
153
|
-
np.int32(dilation_size),
|
|
154
|
-
np.int32(self.first_frame),
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
# Profile the event
|
|
158
|
-
# self.profile_event(event, "Process Frame")
|
|
159
|
-
|
|
160
|
-
# Copy results back to host
|
|
161
|
-
cl.enqueue_copy(
|
|
162
|
-
self.queue,
|
|
163
|
-
self.host_result_buffer,
|
|
164
|
-
self.result_image,
|
|
165
|
-
origin=(0, 0),
|
|
166
|
-
region=(self.width, self.height),
|
|
167
|
-
wait_for=[event],
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
motion_mask_cv = (self.host_result_buffer * 255).astype(np.uint8)
|
|
171
|
-
detections = self.get_contour_detections(motion_mask_cv, area_threshold)
|
|
172
|
-
|
|
173
|
-
self.first_frame = False
|
|
174
|
-
return motion_mask_cv, detections
|
|
175
|
-
|
|
176
|
-
def get_optimal_work_group_size(self) -> Tuple[int, int]:
|
|
177
|
-
max_work_group_size = self.device.get_info(cl.device_info.MAX_WORK_GROUP_SIZE)
|
|
178
|
-
compute_units = self.device.get_info(cl.device_info.MAX_COMPUTE_UNITS)
|
|
179
|
-
optimal_group_count = compute_units * 4
|
|
180
|
-
|
|
181
|
-
for size in [32, 16, 8, 4]:
|
|
182
|
-
work_groups_per_dimension = (self.width // size) * (self.height // size)
|
|
183
|
-
if (
|
|
184
|
-
self.width % size == 0
|
|
185
|
-
and self.height % size == 0
|
|
186
|
-
and size * size <= max_work_group_size
|
|
187
|
-
and work_groups_per_dimension >= optimal_group_count
|
|
188
|
-
):
|
|
189
|
-
return (size, size)
|
|
190
|
-
|
|
191
|
-
return (min(max_work_group_size, self.width), 1)
|
|
192
|
-
|
|
193
|
-
@staticmethod
|
|
194
|
-
def get_contour_detections(
|
|
195
|
-
mask: np.ndarray[Any, Any], area_threshold: int
|
|
196
|
-
) -> list[tuple[float, float, float, float]]:
|
|
197
|
-
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
198
|
-
return [
|
|
199
|
-
(float(x), float(y), float(x + w), float(y + h))
|
|
200
|
-
for contour in contours
|
|
201
|
-
if (_ := cv2.contourArea(contour)) > area_threshold
|
|
202
|
-
for x, y, w, h in [cv2.boundingRect(contour)]
|
|
203
|
-
]
|
|
204
|
-
|
|
205
|
-
@staticmethod
|
|
206
|
-
def profile_event(event: Any, name: str) -> None:
|
|
207
|
-
event.wait()
|
|
208
|
-
elapsed = 1e-9 * (event.profile.end - event.profile.start)
|
|
209
|
-
print(f"{name} execution time: {elapsed:.6f} seconds")
|
|
210
|
-
|
|
211
|
-
def __del__(self):
|
|
212
|
-
# Clean up OpenCL resources
|
|
213
|
-
self.queue.finish()
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
def process_video(display: bool = True):
|
|
217
|
-
cap = cv2.VideoCapture(video_path)
|
|
218
|
-
|
|
219
|
-
if not cap.isOpened():
|
|
220
|
-
print(f"Error opening video file {video_path}")
|
|
221
|
-
return
|
|
222
|
-
|
|
223
|
-
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
|
224
|
-
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
|
225
|
-
|
|
226
|
-
detector = OpenCLMotionDetector(width, height)
|
|
227
|
-
|
|
228
|
-
frame_count = 0
|
|
229
|
-
total_time = 0
|
|
230
|
-
total_gpu_time = 0
|
|
231
|
-
|
|
232
|
-
if display:
|
|
233
|
-
cv2.namedWindow("Motion Detection", cv2.WINDOW_NORMAL)
|
|
234
|
-
cv2.namedWindow("Motion Mask", cv2.WINDOW_NORMAL)
|
|
235
|
-
|
|
236
|
-
while True:
|
|
237
|
-
start_time = time.perf_counter()
|
|
238
|
-
|
|
239
|
-
ret, frame = cap.read()
|
|
240
|
-
if not ret:
|
|
241
|
-
break
|
|
242
|
-
|
|
243
|
-
frame_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
|
244
|
-
|
|
245
|
-
gpu_time = time.perf_counter()
|
|
246
|
-
motion_mask, boxes = detector.process_frame(
|
|
247
|
-
frame_gray,
|
|
248
|
-
MOTION_THRESHOLD,
|
|
249
|
-
DILATION_SIZE,
|
|
250
|
-
AREA_THRESHOLD,
|
|
251
|
-
ALPHA,
|
|
252
|
-
)
|
|
253
|
-
end_time = time.perf_counter()
|
|
254
|
-
|
|
255
|
-
gpu_processing_time = end_time - gpu_time
|
|
256
|
-
total_gpu_time += gpu_processing_time
|
|
257
|
-
|
|
258
|
-
processing_time = end_time - start_time
|
|
259
|
-
total_time += processing_time
|
|
260
|
-
|
|
261
|
-
frame_count += 1
|
|
262
|
-
|
|
263
|
-
if display and motion_mask is not None:
|
|
264
|
-
debug_frame = frame.copy()
|
|
265
|
-
|
|
266
|
-
cv2.putText(
|
|
267
|
-
debug_frame,
|
|
268
|
-
f"Frame: {frame_count}",
|
|
269
|
-
(10, 30),
|
|
270
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
|
271
|
-
1,
|
|
272
|
-
(0, 255, 0),
|
|
273
|
-
2,
|
|
274
|
-
)
|
|
275
|
-
cv2.putText(
|
|
276
|
-
debug_frame,
|
|
277
|
-
f"Boxes: {len(boxes)}",
|
|
278
|
-
(10, 70),
|
|
279
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
|
280
|
-
1,
|
|
281
|
-
(0, 255, 0),
|
|
282
|
-
2,
|
|
283
|
-
)
|
|
284
|
-
|
|
285
|
-
for box in boxes:
|
|
286
|
-
x1, y1, x2, y2 = map(int, box)
|
|
287
|
-
cv2.rectangle(debug_frame, (x1, y1), (x2, y2), (0, 255, 0), 2)
|
|
288
|
-
|
|
289
|
-
fps_text = f"FPS: {1/processing_time:.2f}"
|
|
290
|
-
cv2.putText(
|
|
291
|
-
debug_frame,
|
|
292
|
-
fps_text,
|
|
293
|
-
(10, 110),
|
|
294
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
|
295
|
-
1,
|
|
296
|
-
(0, 255, 0),
|
|
297
|
-
2,
|
|
298
|
-
)
|
|
299
|
-
|
|
300
|
-
cv2.imshow("Motion Mask", motion_mask)
|
|
301
|
-
cv2.imshow("Motion Detection", debug_frame)
|
|
302
|
-
|
|
303
|
-
if cv2.waitKey(1) & 0xFF == ord("q"):
|
|
304
|
-
break
|
|
305
|
-
|
|
306
|
-
cap.release()
|
|
307
|
-
if display:
|
|
308
|
-
cv2.destroyAllWindows()
|
|
309
|
-
|
|
310
|
-
avg_gpu_time = total_gpu_time / frame_count if frame_count > 0 else 0
|
|
311
|
-
avg_time = total_time / frame_count if frame_count > 0 else 0
|
|
312
|
-
avg_fps = 1 / avg_time if avg_time > 0 else 0
|
|
313
|
-
|
|
314
|
-
print(f"Processed {frame_count} frames")
|
|
315
|
-
print(f"Average total processing time per frame: {avg_time:.4f} seconds")
|
|
316
|
-
print(f"Average GPU processing time per frame: {avg_gpu_time:.4f} seconds")
|
|
317
|
-
print(f"Average frames per second: {avg_fps:.2f}")
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
def simulate_stream(img1: np.ndarray[Any, Any], img2: np.ndarray[Any, Any], display: bool = True):
|
|
321
|
-
height, width = img1.shape
|
|
322
|
-
detector = OpenCLMotionDetector(width, height)
|
|
323
|
-
|
|
324
|
-
frame_time = 1 / fps
|
|
325
|
-
total_time = 0
|
|
326
|
-
total_gpu_time = 0
|
|
327
|
-
detected_motions = 0
|
|
328
|
-
|
|
329
|
-
if display:
|
|
330
|
-
cv2.namedWindow("Motion Detection", cv2.WINDOW_NORMAL)
|
|
331
|
-
cv2.namedWindow("Motion Mask", cv2.WINDOW_NORMAL)
|
|
332
|
-
|
|
333
|
-
max_time = time.perf_counter()
|
|
334
|
-
|
|
335
|
-
for frame_count in range(num_frames):
|
|
336
|
-
start_time = time.perf_counter()
|
|
337
|
-
|
|
338
|
-
current_frame = img1 if frame_count % 2 == 0 else img2
|
|
339
|
-
|
|
340
|
-
gpu_time = time.perf_counter()
|
|
341
|
-
motion_mask, boxes = detector.process_frame(
|
|
342
|
-
current_frame,
|
|
343
|
-
MOTION_THRESHOLD,
|
|
344
|
-
DILATION_SIZE,
|
|
345
|
-
AREA_THRESHOLD,
|
|
346
|
-
ALPHA,
|
|
347
|
-
)
|
|
348
|
-
end_time = time.perf_counter()
|
|
349
|
-
|
|
350
|
-
gpu_processing_time = end_time - gpu_time
|
|
351
|
-
total_gpu_time += gpu_processing_time
|
|
352
|
-
|
|
353
|
-
processing_time = end_time - start_time
|
|
354
|
-
total_time += processing_time
|
|
355
|
-
|
|
356
|
-
if boxes:
|
|
357
|
-
detected_motions += 1
|
|
358
|
-
|
|
359
|
-
if display and motion_mask is not None:
|
|
360
|
-
debug_frame = cv2.cvtColor(current_frame, cv2.COLOR_GRAY2BGR)
|
|
361
|
-
|
|
362
|
-
cv2.putText(
|
|
363
|
-
debug_frame,
|
|
364
|
-
f"Frame: {frame_count + 1}",
|
|
365
|
-
(10, 30),
|
|
366
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
|
367
|
-
1,
|
|
368
|
-
(0, 255, 0),
|
|
369
|
-
2,
|
|
370
|
-
)
|
|
371
|
-
cv2.putText(
|
|
372
|
-
debug_frame, f"Boxes: {len(boxes)}", (10, 70), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2
|
|
373
|
-
)
|
|
374
|
-
cv2.putText(
|
|
375
|
-
debug_frame,
|
|
376
|
-
f"FPS: {1/processing_time:.2f}",
|
|
377
|
-
(10, 110),
|
|
378
|
-
cv2.FONT_HERSHEY_SIMPLEX,
|
|
379
|
-
1,
|
|
380
|
-
(0, 255, 0),
|
|
381
|
-
2,
|
|
382
|
-
)
|
|
383
|
-
|
|
384
|
-
for box in boxes:
|
|
385
|
-
x1, y1, x2, y2 = map(int, box)
|
|
386
|
-
cv2.rectangle(debug_frame, (x1, y1), (x2, y2), (0, 255, 0), 2)
|
|
387
|
-
|
|
388
|
-
cv2.imshow("Motion Mask", motion_mask)
|
|
389
|
-
cv2.imshow("Motion Detection", debug_frame)
|
|
390
|
-
|
|
391
|
-
if cv2.waitKey(1) & 0xFF == ord("q"):
|
|
392
|
-
break
|
|
393
|
-
|
|
394
|
-
# Simulate frame rate
|
|
395
|
-
time_to_wait = frame_time - processing_time
|
|
396
|
-
if time_to_wait > 0:
|
|
397
|
-
time.sleep(time_to_wait)
|
|
398
|
-
|
|
399
|
-
max_time = time.perf_counter() - max_time
|
|
400
|
-
|
|
401
|
-
print(f"Max time: {max_time:.4f} seconds")
|
|
402
|
-
|
|
403
|
-
if display:
|
|
404
|
-
cv2.destroyAllWindows()
|
|
405
|
-
|
|
406
|
-
avg_gpu_time = total_gpu_time / num_frames
|
|
407
|
-
avg_time = total_time / num_frames
|
|
408
|
-
avg_fps = 1 / avg_time if avg_time > 0 else 0
|
|
409
|
-
|
|
410
|
-
print(f"Processed {num_frames} frames")
|
|
411
|
-
print(f"Average total processing time per frame: {avg_time:.4f} seconds")
|
|
412
|
-
print(f"Average GPU processing time per frame: {avg_gpu_time:.4f} seconds")
|
|
413
|
-
print(f"Average frames per second: {avg_fps:.2f}")
|
|
414
|
-
print(f"Frames with detected motion: {detected_motions}")
|
|
415
|
-
print(f"Percentage of frames with motion: {(detected_motions/num_frames)*100:.2f}%")
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if __name__ == "__main__":
|
|
419
|
-
video = False
|
|
420
|
-
display = False
|
|
421
|
-
|
|
422
|
-
if video:
|
|
423
|
-
process_video(display)
|
|
424
|
-
else:
|
|
425
|
-
img1 = cv2.imread(image1_path, cv2.IMREAD_GRAYSCALE)
|
|
426
|
-
img2 = cv2.imread(image2_path, cv2.IMREAD_GRAYSCALE)
|
|
427
|
-
simulate_stream(img1, img2, display)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|