fix: frame-extract 默认裁切区域改为画面底部 1/4

- 默认 crop 由 [0,0.82,1,0.18] 调整为 [0,0.75,1,0.25]:字幕很少出现在
  画面上半部分,扩大裁切高度提升 OCR 召回
- 同步更新 ocr-subtitle 工作流 DAG 与参数覆盖测试
This commit is contained in:
2026-08-23 16:25:17 +08:00
parent 3aa05bbf76
commit 5688f38d62
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ from wov_sdk.models import InvokeRequest, InvokeResponse
logger = get_logger("frame-extract")
# 默认裁切:画面底部 18% 区域(常见字幕位置)。
DEFAULT_CROP = [0.0, 0.82, 1.0, 0.18]
# 默认裁切:画面底部 1/4 区域(字幕区,字幕很少出现在画面上半部分)。
DEFAULT_CROP = [0.0, 0.75, 1.0, 0.25]
def _parse_crop(raw) -> list[float] | None:
+2 -2
View File
@@ -293,12 +293,12 @@ def test_create_run_with_param_overrides() -> None:
uploaded = client.post(
f"/api/apps/{workflow_id}/runs",
files={"file": ("sample.txt", b"x", "text/plain")},
data={"params": '{"step": {"crop": [0, 0.82, 1, 0.18]}}'},
data={"params": '{"step": {"crop": [0, 0.75, 1, 0.25]}}'},
)
assert uploaded.status_code == 200
run_id = uploaded.json()["id"]
run = client.get(f"/api/runs/{run_id}").json()
assert run["param_overrides"] == {"step": {"crop": [0, 0.82, 1, 0.18]}}
assert run["param_overrides"] == {"step": {"crop": [0, 0.75, 1, 0.25]}}
# 非法 JSON 返回 422。
bad = client.post(
f"/api/apps/{workflow_id}/runs",
+2 -2
View File
@@ -14,9 +14,9 @@
"interval_seconds": 0.5,
"crop": [
0,
0.82,
0.75,
1,
0.18
0.25
]
},
"inputs": {