Unverified Commit 3a616cf2 authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub

Merge pull request #636 from myhloli/dev

fix(pdf-extract): ensure model is set to evaluation mode before processing
parents 19a74db8 4811a3d1
......@@ -64,6 +64,7 @@ def mfr_model_init(weight_dir, cfg_path, _device_='cpu'):
task = tasks.setup_task(cfg)
model = task.build_model(cfg)
model = model.to(_device_)
model.eval()
vis_processor = load_processor('formula_image_eval', cfg.config.datasets.formula_rec_eval.vis_processor.eval)
mfr_transform = transforms.Compose([vis_processor, ])
return [model, mfr_transform]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment