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": {