From f04b1aed4146385455ed250b774eab0eaa59bdef Mon Sep 17 00:00:00 2001 From: yueliuli <1628111725@qq.com> Date: Tue, 21 Apr 2026 15:12:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=20**gradio=20=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=94=AF=E6=8C=81**:=20=E6=96=B0=E5=A2=9E=20Gradio=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=EF=BC=8C=E4=B8=BA=20AI=20?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E9=9B=86=E6=88=90=E6=8F=90=E4=BE=9B=E6=9B=B4?= =?UTF-8?q?=E7=81=B5=E6=B4=BB=E7=9A=84=E6=96=B9=E6=A1=88=202.=20**?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84**:=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E7=9A=84=E9=9A=90=E6=82=A3=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=EF=BC=88=E9=85=8D=E7=BD=AE=20=E2=86=92=20?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=20=E2=86=92=20=E7=BB=93=E6=9E=9C=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=EF=BC=89=20=20=20-=20=E5=88=A0=E9=99=A4=E7=89=A9?= =?UTF-8?q?=E4=BD=93=E5=88=97=E8=A1=A8=20=20=20-=20=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E9=9A=90=E6=82=A3=E5=88=97=E8=A1=A8=E8=AF=BB=E5=8F=96=20=20=20?= =?UTF-8?q?-=20=E5=AE=8C=E6=88=90=E9=9A=90=E6=82=A3=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=203.=20**=E7=BB=84=E4=BB=B6=E4=B8=B0?= =?UTF-8?q?=E5=AF=8C**:=20=E6=96=B0=E5=A2=9E=20`ItemList`=20=E5=92=8C=20`T?= =?UTF-8?q?imeline`=20=E7=AD=89=E5=8F=AF=E5=A4=8D=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=204.=20**=E6=9E=B6=E6=9E=84=E4=BC=98=E5=8C=96**:=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E7=BB=93=E6=9E=84=E9=87=8D=E7=BB=84=EF=BC=8C?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=89=B2=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- package.json | 3 +- src/components.d.ts | 17 + src/components/hazard_inspect/ItemList.vue | 76 ++ src/components/hazard_inspect/left_bar.vue | 0 src/components/hazard_inspect/timeline.vue | 211 +++++ src/composables/api.ts | 22 + src/pages/index.vue | 8 +- src/pages/nav/1_隐患检查.vue | 78 -- src/pages/nav/VideoTrackDemo.vue | 156 ++++ src/pages/nav/edit2.html | 864 ++++++++++++++++++ .../nav/hazardCheck/1_隐患检查 copy.vue | 241 +++++ .../nav/hazardCheck/HazardCheckResult.vue | 450 +++++++++ src/pages/nav/hazardCheck/index.vue | 161 ++++ src/styles/element/index.scss | 8 +- src/typed-router.d.ts | 5 +- 16 files changed, 2215 insertions(+), 87 deletions(-) create mode 100644 src/components/hazard_inspect/ItemList.vue delete mode 100644 src/components/hazard_inspect/left_bar.vue create mode 100644 src/components/hazard_inspect/timeline.vue create mode 100644 src/composables/api.ts delete mode 100644 src/pages/nav/1_隐患检查.vue create mode 100644 src/pages/nav/VideoTrackDemo.vue create mode 100644 src/pages/nav/edit2.html create mode 100644 src/pages/nav/hazardCheck/1_隐患检查 copy.vue create mode 100644 src/pages/nav/hazardCheck/HazardCheckResult.vue create mode 100644 src/pages/nav/hazardCheck/index.vue diff --git a/index.html b/index.html index 4bbef6c..b732f05 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/package.json b/package.json index 3ca1325..a32fbb5 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", - "@labelbee/lb-annotation": "^1.27.0", - "@labelbee/lb-utils": "^1.19.0", + "@gradio/client": "^2.2.0", "@vueuse/core": "^13.6.0", "element-plus": "^2.10.5", "vue": "^3.5.18", diff --git a/src/components.d.ts b/src/components.d.ts index 95abf16..4ebbd6b 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -17,11 +17,18 @@ declare module 'vue' { ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard'] + ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElContainer: typeof import('element-plus/es')['ElContainer'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] + ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] + ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] + ElFooter: typeof import('element-plus/es')['ElFooter'] ElForItem: typeof import('element-plus/es')['ElForItem'] + ElForm: typeof import('element-plus/es')['ElForm'] + ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] @@ -29,15 +36,25 @@ declare module 'vue' { ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] + ElOption: typeof import('element-plus/es')['ElOption'] + ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] + ElSegmented: typeof import('element-plus/es')['ElSegmented'] + ElSelect: typeof import('element-plus/es')['ElSelect'] + ElSelectV2: typeof import('element-plus/es')['ElSelectV2'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTag: typeof import('element-plus/es')['ElTag'] + ElText: typeof import('element-plus/es')['ElText'] + ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] HelloWorld: typeof import('./components/HelloWorld.vue')['default'] + ItemList: typeof import('./components/hazard_inspect/ItemList.vue')['default'] Left_bar: typeof import('./components/hazard_inspect/left_bar.vue')['default'] Logos: typeof import('./components/Logos.vue')['default'] MessageBoxDemo: typeof import('./components/MessageBoxDemo.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + Timeline: typeof import('./components/hazard_inspect/timeline.vue')['default'] } } diff --git a/src/components/hazard_inspect/ItemList.vue b/src/components/hazard_inspect/ItemList.vue new file mode 100644 index 0000000..7169cc0 --- /dev/null +++ b/src/components/hazard_inspect/ItemList.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/components/hazard_inspect/left_bar.vue b/src/components/hazard_inspect/left_bar.vue deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/hazard_inspect/timeline.vue b/src/components/hazard_inspect/timeline.vue new file mode 100644 index 0000000..485952f --- /dev/null +++ b/src/components/hazard_inspect/timeline.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/src/composables/api.ts b/src/composables/api.ts new file mode 100644 index 0000000..7771674 --- /dev/null +++ b/src/composables/api.ts @@ -0,0 +1,22 @@ +import { Client } from '@gradio/client' + +export async function runApi(funcName: string, params: Record) { + // 声明 client 变量,用于后续释放连接 + try { + // 1. 连接客户端(修复:function 是关键字,不能做变量名) + const client = await Client.connect('http://127.0.0.1:7860') + + // 2. 调用预测接口,传入方法名和参数 + const result = await client.predict(funcName, params) + + // 3. 打印返回结果 + // console.log('接口调用成功,返回数据:', result.data) + + return result.data + } + catch (error) { + // 捕获异常,打印错误信息 + console.error('接口调用失败:', error) + throw error + } +} diff --git a/src/pages/index.vue b/src/pages/index.vue index 115316b..9da7706 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -6,9 +6,15 @@ 安责险隐患检查
- + 隐患检查 + + 物体跟踪 demo + + + 物体跟踪 demo2 +
diff --git a/src/pages/nav/1_隐患检查.vue b/src/pages/nav/1_隐患检查.vue deleted file mode 100644 index 2841378..0000000 --- a/src/pages/nav/1_隐患检查.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - diff --git a/src/pages/nav/VideoTrackDemo.vue b/src/pages/nav/VideoTrackDemo.vue new file mode 100644 index 0000000..a619896 --- /dev/null +++ b/src/pages/nav/VideoTrackDemo.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/src/pages/nav/edit2.html b/src/pages/nav/edit2.html new file mode 100644 index 0000000..7e81aa8 --- /dev/null +++ b/src/pages/nav/edit2.html @@ -0,0 +1,864 @@ + + + + + + ProVision - 智能视频标注编辑器 + + + + + + +
+
+
+ + + +
+

+ ProVision + | 视频标注编辑器 +

+
+
+
+ + 系统就绪 +
+ +
+
+ + +
+ + + + +
+ +
+ + + + +
+ +
+
+
+
+ + +
+
+ +
+ 00:00 / + 00:10 +
+
+
+ + + + +
+
+
+
+ + +
+ +
+ +
+ 轨道视图 +
+ + +
+ +
+
+
+ + +
+ + +
+ +
+
+
+
+ + + +
+ + + + diff --git a/src/pages/nav/hazardCheck/1_隐患检查 copy.vue b/src/pages/nav/hazardCheck/1_隐患检查 copy.vue new file mode 100644 index 0000000..eb52be0 --- /dev/null +++ b/src/pages/nav/hazardCheck/1_隐患检查 copy.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/src/pages/nav/hazardCheck/HazardCheckResult.vue b/src/pages/nav/hazardCheck/HazardCheckResult.vue new file mode 100644 index 0000000..7cc4872 --- /dev/null +++ b/src/pages/nav/hazardCheck/HazardCheckResult.vue @@ -0,0 +1,450 @@ + + + + + diff --git a/src/pages/nav/hazardCheck/index.vue b/src/pages/nav/hazardCheck/index.vue new file mode 100644 index 0000000..2c5afd0 --- /dev/null +++ b/src/pages/nav/hazardCheck/index.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/styles/element/index.scss b/src/styles/element/index.scss index 9f949fd..69e874f 100644 --- a/src/styles/element/index.scss +++ b/src/styles/element/index.scss @@ -3,19 +3,19 @@ $--colors: ( 'base': #409eff, ), 'success': ( - 'base': #21ba45, + 'base': #67c23a, ), 'warning': ( - 'base': #f2711c, + 'base': #e6a23c, ), 'danger': ( - 'base': #db2828, + 'base': #f56c6c, ), 'error': ( 'base': #db2828, ), 'info': ( - 'base': #42b8dd, + 'base': #909399, ), ); diff --git a/src/typed-router.d.ts b/src/typed-router.d.ts index 26613cf..ce0c0fe 100644 --- a/src/typed-router.d.ts +++ b/src/typed-router.d.ts @@ -19,6 +19,9 @@ declare module 'vue-router/auto-routes' { */ export interface RouteNamedMap { '/': RouteRecordInfo<'/', '/', Record, Record>, - '/nav/1_隐患检查': RouteRecordInfo<'/nav/1_隐患检查', '/nav/1_隐患检查', Record, Record>, + '/nav/hazardCheck/': RouteRecordInfo<'/nav/hazardCheck/', '/nav/hazardCheck', Record, Record>, + '/nav/hazardCheck/1_隐患检查 copy': RouteRecordInfo<'/nav/hazardCheck/1_隐患检查 copy', '/nav/hazardCheck/1_隐患检查 copy', Record, Record>, + '/nav/hazardCheck/HazardCheckResult': RouteRecordInfo<'/nav/hazardCheck/HazardCheckResult', '/nav/hazardCheck/HazardCheckResult', Record, Record>, + '/nav/VideoTrackDemo': RouteRecordInfo<'/nav/VideoTrackDemo', '/nav/VideoTrackDemo', Record, Record>, } }