feat: ASRX hybrid pipeline, identity history, worker fixes, checkpoint system
This commit is contained in:
@@ -84,18 +84,22 @@ def process_ocr(
|
||||
|
||||
|
||||
def _fallback(video_path, output_path, uuid, sample_interval):
|
||||
"""Fallback to original PaddleOCR implementation"""
|
||||
"""Fallback to MPS OCR implementation"""
|
||||
import importlib
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"paddle_ocr",
|
||||
os.path.join(os.path.dirname(__file__), "ocr_paddle.py")
|
||||
"ocr_mps",
|
||||
os.path.join(os.path.dirname(__file__), "ocr_processor_mps.py")
|
||||
)
|
||||
if spec is None:
|
||||
print("[OCR] No fallback available, returning empty result", file=sys.stderr)
|
||||
return {"frame_count": 0, "fps": 0, "frames": []}
|
||||
paddle = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(paddle)
|
||||
return paddle.process_ocr(video_path, output_path, uuid, sample_interval=sample_interval)
|
||||
ocr_mps = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(ocr_mps)
|
||||
return ocr_mps.process_video_ocr(
|
||||
video_path=video_path,
|
||||
output_path=output_path,
|
||||
sample_interval=sample_interval
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user