add fitz_preprocess as default preprocess for image parser to align with demo

This commit is contained in:
zhangwei13
2025-08-11 09:44:05 +08:00
parent af3a52fa32
commit 6a854390b4
+8 -5
View File
@@ -379,10 +379,10 @@ def main():
"--num_thread", type=int, default=16, "--num_thread", type=int, default=16,
help="" help=""
) )
# parser.add_argument( parser.add_argument(
# "--fitz_preprocess", type=bool, default=False, "--no_fitz_preprocess", action='store_true',
# help="False will use tikz dpi upsample pipeline, good for images which has been render with low dpi, but maybe result in higher computational costs" help="False will use tikz dpi upsample pipeline, good for images which has been render with low dpi, but maybe result in higher computational costs"
# ) )
parser.add_argument( parser.add_argument(
"--min_pixels", type=int, default=None, "--min_pixels", type=int, default=None,
help="" help=""
@@ -412,11 +412,14 @@ def main():
use_hf=args.use_hf, use_hf=args.use_hf,
) )
fitz_preprocess = not args.no_fitz_preprocess
if fitz_preprocess:
print(f"Using fitz preprocess for image input, check the change of the image pixels")
result = dots_ocr_parser.parse_file( result = dots_ocr_parser.parse_file(
args.input_path, args.input_path,
prompt_mode=args.prompt, prompt_mode=args.prompt,
bbox=args.bbox, bbox=args.bbox,
fitz_preprocess=True, fitz_preprocess=fitz_preprocess,
) )