diff --git a/README.md b/README.md index 2f85d71..a980fb3 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,6 @@ python/python.exe -X utf8 -m unittest discover -s tests -p test_worker.py -v | `time_elapsed` | 否 | 计时 | | `hand_in_region` | 否 | MediaPipe | | `hand_move` | 否 | MediaPipe(起点证据来自上一帧的轨迹) | -| `hand_action` | 否 | MediaPipe | | `object_present` | 是 | YOLO | | `object_in_zone` | 是 | YOLO | | `hand_near_object` | 是 | YOLO + MediaPipe | @@ -162,7 +161,7 @@ python/python.exe -X utf8 -m unittest discover -s tests -p test_worker.py -v ### 配方编辑器 SOP 页配方行的「编辑 / 新建」。表单式,四个 tab:步骤 / 区域 / 全局设置 / 检测模型, -字段与 YAML 一一对应;method、区域名、hand、动作、违规类型都是下拉选——就是为了不让 +字段与 YAML 一一对应;method、区域名、hand、违规类型都是下拉选——就是为了不让 "照抄别人的 YAML 拼错一个字母"这种事发生(下拉候选就是 `ConditionMethod` 那几项)。 区域改键名会同步更新所有引用它的步骤;删区域会清掉引用。 @@ -200,7 +199,7 @@ dotnet run --project tests/RegionEditorSmoke/RegionEditorSmoke.csproj ## 判定语义(踩过的坑) - **稳定帧门控**:按 `(步骤Id, 条件序号)` 累计连续命中帧数,达标才放行,未命中立即清零。 - `time_elapsed` / `hand_move` / `hand_action` 豁免(自带时序或瞬时语义)。 + `time_elapsed` / `hand_move` 豁免(自带时序或瞬时语义)。 - **Start / Reset 必须清空跨帧状态**,否则第二轮会"秒过",防抖形同虚设。 - **区域坐标是绝对像素**,必须在真机画面上标定,别照抄别人的 YAML。 diff --git a/src/SopHelper.App/VVMs/RecipeEditor/EditorNodes.cs b/src/SopHelper.App/VVMs/RecipeEditor/EditorNodes.cs index 9aece6e..abe63c7 100644 --- a/src/SopHelper.App/VVMs/RecipeEditor/EditorNodes.cs +++ b/src/SopHelper.App/VVMs/RecipeEditor/EditorNodes.cs @@ -107,7 +107,6 @@ public class RecipeNode : EditorNode ConditionMethod.TimeElapsed, ConditionMethod.HandInRegion, ConditionMethod.HandMove, - ConditionMethod.HandAction, ConditionMethod.HandNearObject, ConditionMethod.ObjectPresent, ConditionMethod.ObjectInZone, @@ -115,7 +114,6 @@ public class RecipeNode : EditorNode ]; Hands = ["any", "left", "right"]; - Actions = ["", "pickup", "putdown"]; ViolationTypes = [ViolationType.Timeout, ViolationType.ObjectRemoved]; AddRegionCommand = new DelegateCommand(() => { AddRegion(); Changed?.Invoke(); }); @@ -249,9 +247,6 @@ public class RecipeNode : EditorNode /// hand 下拉候选 public IReadOnlyList Hands { get; } - /// action 下拉候选(hand_action 用) - public IReadOnlyList Actions { get; } - /// 违规类型下拉候选 public IReadOnlyList ViolationTypes { get; } @@ -862,7 +857,6 @@ public class ConditionNode : EditorNode private float _minConfidence = 0.7f; private int _stableFrames = 5; private int _durationMs; - private string _action = ""; /// 判定方法 public string Method @@ -934,13 +928,6 @@ public class ConditionNode : EditorNode set { SetProperty(ref _durationMs, value); } } - /// 动作语义(hand_action 用) - public string Action - { - get { return _action; } - set { SetProperty(ref _action, value); } - } - /// 读入 public static ConditionNode From(StepCondition from) => new() { @@ -954,7 +941,6 @@ public class ConditionNode : EditorNode MinConfidence = from.MinConfidence, StableFrames = from.StableFrames, DurationMs = from.DurationMs, - Action = from.Action, }; /// 写出 @@ -970,7 +956,6 @@ public class ConditionNode : EditorNode MinConfidence = MinConfidence, StableFrames = StableFrames, DurationMs = DurationMs, - Action = Action, }; } diff --git a/src/SopHelper.App/VVMs/RecipeEditor/RecipeEditor.xaml b/src/SopHelper.App/VVMs/RecipeEditor/RecipeEditor.xaml index 273f88c..3524528 100644 --- a/src/SopHelper.App/VVMs/RecipeEditor/RecipeEditor.xaml +++ b/src/SopHelper.App/VVMs/RecipeEditor/RecipeEditor.xaml @@ -301,11 +301,8 @@ - - - - + + @@ -332,7 +329,7 @@ - diff --git a/src/SopHelper.Engine/Sop/ConditionEvaluator.cs b/src/SopHelper.Engine/Sop/ConditionEvaluator.cs index 7fe31c7..6f6a7af 100644 --- a/src/SopHelper.Engine/Sop/ConditionEvaluator.cs +++ b/src/SopHelper.Engine/Sop/ConditionEvaluator.cs @@ -169,7 +169,6 @@ public class ConditionEvaluator } case ConditionMethod.HandMove: - case ConditionMethod.HandAction: { var from = Region(condition.FromRegion); var to = Region(condition.ToRegion); @@ -201,7 +200,7 @@ public class ConditionEvaluator } /// - /// 稳定帧门控。time_elapsed / hand_move / hand_action 豁免 + /// 稳定帧门控。time_elapsed / hand_move 豁免 /// (自带时序或瞬时交互语义,与参考项目的豁免清单一致)。 /// private ConditionResult ApplyStableGate(int stepId, int probeSeed, StepCondition condition, ConditionResult raw) @@ -209,8 +208,7 @@ public class ConditionEvaluator var method = condition.Method.ToLowerInvariant(); var exempt = method == ConditionMethod.TimeElapsed - || method == ConditionMethod.HandMove - || method == ConditionMethod.HandAction; + || method == ConditionMethod.HandMove; if (exempt) return raw; diff --git a/src/SopHelper.Engine/Sop/SopConfig.cs b/src/SopHelper.Engine/Sop/SopConfig.cs index 93ec458..9a86027 100644 --- a/src/SopHelper.Engine/Sop/SopConfig.cs +++ b/src/SopHelper.Engine/Sop/SopConfig.cs @@ -183,8 +183,6 @@ public class StepCondition /// 计时毫秒(time_elapsed 用) public int DurationMs { get; set; } - /// 动作语义(hand_action 用:pickup / putdown) - public string Action { get; set; } = ""; } /// @@ -205,9 +203,6 @@ public static class ConditionMethod /// 手从 A 区移到 B 区(7 次;配方里写作 hand_move) public const string HandMove = "hand_move"; - /// 取放动作(10 次;= hand_move + 动作语义) - public const string HandAction = "hand_action"; - /// 手-物相邻(3 次) public const string HandNearObject = "hand_near_object"; diff --git a/src/SopHelper.Engine/Sop/SopConfigLoader.cs b/src/SopHelper.Engine/Sop/SopConfigLoader.cs index 6c82f5b..518ccd3 100644 --- a/src/SopHelper.Engine/Sop/SopConfigLoader.cs +++ b/src/SopHelper.Engine/Sop/SopConfigLoader.cs @@ -87,7 +87,6 @@ public static partial class SopConfigLoader ConditionMethod.ObjectInZone, ConditionMethod.HandInRegion, ConditionMethod.HandMove, - ConditionMethod.HandAction, ConditionMethod.HandNearObject, ConditionMethod.PersonPresent, ConditionMethod.TimeElapsed, @@ -150,7 +149,7 @@ public static partial class SopConfigLoader } /// - /// 该方法是否依赖 YOLO 模型。手部类(hand_in_region / hand_move / hand_action) + /// 该方法是否依赖 YOLO 模型。手部类(hand_in_region / hand_move) /// 与计时只用 MediaPipe,不在此列;hand_near_object 要比对物体,算依赖。 /// private static bool NeedsModel(string method) => method.ToLowerInvariant() switch