Improve speed
This commit is contained in:
@@ -190,8 +190,17 @@ def normalize_batch_input_video(source_path: Path, output_path: Path) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
def stage_batch_pipeline_input(*, source_path: Path, dest_path: Path) -> None:
|
||||
"""Copy upload to digest-level pipeline input without browser normalize/transcode."""
|
||||
|
||||
dest_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if dest_path.is_file() and dest_path.stat().st_size > 0:
|
||||
return
|
||||
shutil.copy2(source_path, dest_path)
|
||||
|
||||
|
||||
def ensure_batch_pipeline_input_video(*, source_path: Path, dest_path: Path) -> None:
|
||||
import shutil as sh
|
||||
"""Browser-compatible normalize/copy; use only for visualization inputs, not batch inference."""
|
||||
|
||||
dest_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if dest_path.is_file() and dest_path.stat().st_size > 0 and not batch_input_needs_normalize(dest_path):
|
||||
@@ -205,7 +214,7 @@ def ensure_batch_pipeline_input_video(*, source_path: Path, dest_path: Path) ->
|
||||
dest_path,
|
||||
)
|
||||
if not dest_path.is_file():
|
||||
sh.copy2(source_path, dest_path)
|
||||
shutil.copy2(source_path, dest_path)
|
||||
|
||||
|
||||
def transcode_visualization_for_browser(source_path: Path, output_path: Path) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user