From 5688f38d620b33859a46e22be55cb143ba2864c5 Mon Sep 17 00:00:00 2001 From: catShark <1716967236@qq.com> Date: Sun, 23 Aug 2026 16:25:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20frame-extract=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=A3=81=E5=88=87=E5=8C=BA=E5=9F=9F=E6=94=B9=E4=B8=BA=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E5=BA=95=E9=83=A8=201/4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 默认 crop 由 [0,0.82,1,0.18] 调整为 [0,0.75,1,0.25]:字幕很少出现在 画面上半部分,扩大裁切高度提升 OCR 召回 - 同步更新 ocr-subtitle 工作流 DAG 与参数覆盖测试 --- nodes/frame_extract.py | 4 ++-- tests/test_apps_api.py | 4 ++-- workflows/ocr-subtitle.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nodes/frame_extract.py b/nodes/frame_extract.py index 4165ac6..5c3e526 100644 --- a/nodes/frame_extract.py +++ b/nodes/frame_extract.py @@ -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: diff --git a/tests/test_apps_api.py b/tests/test_apps_api.py index 7775216..ab978b2 100644 --- a/tests/test_apps_api.py +++ b/tests/test_apps_api.py @@ -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", diff --git a/workflows/ocr-subtitle.json b/workflows/ocr-subtitle.json index 2d6e68c..2d9e863 100644 --- a/workflows/ocr-subtitle.json +++ b/workflows/ocr-subtitle.json @@ -14,9 +14,9 @@ "interval_seconds": 0.5, "crop": [ 0, - 0.82, + 0.75, 1, - 0.18 + 0.25 ] }, "inputs": {