MCPcopy
hub / github.com/BIT-DataLab/Edit-Banana / main

Function main

scripts/merge_xml.py:23–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def main():
24 import argparse
25 parser = argparse.ArgumentParser(description="Run pipeline and merge XML (orchestration entry).")
26 parser.add_argument("-i", "--input", required=True, help="Input image path")
27 parser.add_argument("-o", "--output", default=None, help="Output directory (default: config)")
28 parser.add_argument("--no-text", action="store_true", help="Skip OCR/text step")
29 args = parser.parse_args()
30
31 if not os.path.exists(args.input):
32 print(f"Error: file not found {args.input}")
33 sys.exit(1)
34
35 config = load_config()
36 output_dir = args.output or config.get("paths", {}).get("output_dir", "./output")
37 os.makedirs(output_dir, exist_ok=True)
38
39 pipeline = Pipeline(config)
40 result = pipeline.process_image(
41 args.input,
42 output_dir=output_dir,
43 with_refinement=False,
44 with_text=not args.no_text,
45 )
46 if result:
47 print(f"Output: {result}")
48 else:
49 sys.exit(1)
50
51
52if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

process_imageMethod · 0.95
load_configFunction · 0.90
PipelineClass · 0.90

Tested by

no test coverage detected