테스트 파일 정리 및 일부 함수 재구조화, playreel analyze까지
This commit is contained in:
1 parent
5c84733a8b
commit
53f308eac2
35 files changed
+1019
-49
No files matched your search
@@ -0,0 +1,33 @@
|
||||
"""detect 수동 확인용.
|
||||
|
||||
사용: uv run python -m tests.poster_alive.test_detect <포스터경로>
|
||||
결과는 test_result/ 아래에 .detect.txt / .grid.jpg / .check.jpg 세 파일로 떨어진다.
|
||||
"""
|
||||
import asyncio
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from services.detect import detect
|
||||
|
||||
TEST_RESULT_DIR = Path(__file__).parent.parent / "test_result" / "poster_alive"
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
poster_path = Path(sys.argv[1])
|
||||
TEST_RESULT_DIR.mkdir(exist_ok=True)
|
||||
output_base = TEST_RESULT_DIR / poster_path.stem
|
||||
|
||||
result = await detect(poster_path)
|
||||
|
||||
text_path = output_base.with_suffix(".detect.txt")
|
||||
grid_path = output_base.with_suffix(".grid.jpg")
|
||||
check_path = output_base.with_suffix(".check.jpg")
|
||||
|
||||
text_path.write_text(result.data.model_dump_json(indent=2), encoding="utf-8")
|
||||
result.grid.save(grid_path, quality=90)
|
||||
result.check.save(check_path, quality=90)
|
||||
print(text_path, grid_path, check_path, sep="\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in new issue
Block a user