From f3418cd1a8c718fa6184d7e547623d90ea17e7b4 Mon Sep 17 00:00:00 2001 From: sophelper <123211521@163.com> Date: Fri, 6 Nov 2026 19:20:00 +0800 Subject: [PATCH] Migrate selected camera, branding, handedness and YOLO safeguards to main --- README.md | 6 + src/SopHelper.App/App.xaml | 6 +- src/SopHelper.App/Assets/BellwetherLogo.xaml | 167 ++++++++++++++++++ src/SopHelper.App/Assets/bws.svg | 8 + src/SopHelper.App/Themes/Styles.xaml | 111 +++++++----- .../VVMs/MainWindow/MainWindow.xaml | 18 +- .../VVMs/RecipeEditor/EditorNodes.cs | 10 ++ .../VVMs/RecipeEditor/RecipeEditor.xaml | 7 + .../RecipeEditor/RecipeEditorViewModel.cs | 11 ++ src/SopHelper.App/VVMs/SopPage/HandOverlay.cs | 7 +- .../VVMs/SopPage/SopPageViewModel.cs | 60 ++++++- src/SopHelper.Engine/Camera/CameraService.cs | 12 ++ .../Camera/HikvisionCameraService.cs | 13 ++ src/SopHelper.Engine/Camera/ICameraService.cs | 4 + src/SopHelper.Engine/Common/Types.cs | 3 + .../Inference/HandednessDecoder.cs | 25 +++ .../Inference/HandednessStabilizer.cs | 109 ++++++++++++ .../Inference/MediaPipeHandDetector.cs | 9 +- .../Inference/YoloDetector.cs | 37 +++- .../Pipeline/DetectionPipeline.cs | 9 +- src/SopHelper.Engine/Sop/SopConfig.cs | 4 + tests/HandednessSmoke/HandednessSmoke.csproj | 13 ++ tests/HandednessSmoke/Program.cs | 121 +++++++++++++ tests/RegionEditorSmoke/Program.cs | 45 +++++ tests/YoloModelSmoke/Program.cs | 32 ++++ tests/YoloModelSmoke/YoloModelSmoke.csproj | 12 ++ 26 files changed, 796 insertions(+), 63 deletions(-) create mode 100644 src/SopHelper.App/Assets/BellwetherLogo.xaml create mode 100644 src/SopHelper.App/Assets/bws.svg create mode 100644 src/SopHelper.Engine/Inference/HandednessDecoder.cs create mode 100644 src/SopHelper.Engine/Inference/HandednessStabilizer.cs create mode 100644 tests/HandednessSmoke/HandednessSmoke.csproj create mode 100644 tests/HandednessSmoke/Program.cs create mode 100644 tests/YoloModelSmoke/Program.cs create mode 100644 tests/YoloModelSmoke/YoloModelSmoke.csproj diff --git a/README.md b/README.md index a643b85..62f6632 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,12 @@ SOP 页配方行的「编辑 / 新建」。表单式,四个 tab:步骤 / 区 "照抄别人的 YAML 拼错一个字母"这种事发生(下拉候选就是 `ConditionMethod` 那几项)。 区域改键名会同步更新所有引用它的步骤;删区域会清掉引用。 +“检测模型”页选择普通 YOLO 的 ONNX 文件和对应类别表;类别表留空时可从模型的 `names` 元数据读取。 +加载时会检查类别数量和输出格式,加载失败会在 SOP 日志提示,切换到缺失模型也会释放旧模型。 +该页的“相机曝光(μs)”随配方保存到 `sop.settings.exposure_time_us`,例如 10000 表示 10 毫秒。 +海康相机在区域取图与 SOP 启动前关闭自动曝光并应用该值;留空保留设备设置。UVC 暂不支持微秒曝光设置,请留空。 +程序启动时自动扫描相机并恢复上次成功使用的设备,主窗口默认最大化。 + 区域页支持图像画框标定: 1. 停止运行,在 SOP 页选好相机,打开「编辑 / 新建」→「区域」。 diff --git a/src/SopHelper.App/App.xaml b/src/SopHelper.App/App.xaml index 1eef9b7..82e167e 100644 --- a/src/SopHelper.App/App.xaml +++ b/src/SopHelper.App/App.xaml @@ -1,7 +1,7 @@ + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:prism="http://prismlibrary.com/"> diff --git a/src/SopHelper.App/Assets/BellwetherLogo.xaml b/src/SopHelper.App/Assets/BellwetherLogo.xaml new file mode 100644 index 0000000..d7dfec9 --- /dev/null +++ b/src/SopHelper.App/Assets/BellwetherLogo.xaml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/SopHelper.App/Assets/bws.svg b/src/SopHelper.App/Assets/bws.svg new file mode 100644 index 0000000..97d0cb0 --- /dev/null +++ b/src/SopHelper.App/Assets/bws.svg @@ -0,0 +1,8 @@ + + +贝沃思 BELLWETHER +透明背景,左侧为蓝红 BWS 标志,右侧上方为贝沃思,下方为 BELLWETHER。 + + + + diff --git a/src/SopHelper.App/Themes/Styles.xaml b/src/SopHelper.App/Themes/Styles.xaml index 98fca4b..11b291f 100644 --- a/src/SopHelper.App/Themes/Styles.xaml +++ b/src/SopHelper.App/Themes/Styles.xaml @@ -1,7 +1,6 @@ - + - + @@ -19,7 +18,9 @@ - - + - + - + - + - - - +