Commit a2808f3a authored by myhloli's avatar myhloli
Browse files

Merge remote-tracking branch 'origin/dev' into dev

parents 3f2bafa8 dba28389
......@@ -257,13 +257,13 @@ def may_batch_image_analyze(
if str(device).startswith('npu') or str(device).startswith('cuda'):
gpu_memory = int(os.getenv('VIRTUAL_VRAM_SIZE', round(get_vram(device))))
if gpu_memory is not None:
if gpu_memory >= 20:
if gpu_memory >= 16:
batch_ratio = 16
elif gpu_memory >= 15:
elif gpu_memory >= 12:
batch_ratio = 8
elif gpu_memory >= 10:
elif gpu_memory >= 8:
batch_ratio = 4
elif gpu_memory >= 7:
elif gpu_memory >= 6:
batch_ratio = 2
else:
batch_ratio = 1
......
......@@ -30,7 +30,6 @@ class UnimernetModel(object):
self.model = self.model.to(dtype=torch.float16)
self.model.eval()
def predict(self, mfd_res, image):
formula_list = []
mf_image_list = []
......
......@@ -4,12 +4,12 @@ from huggingface_hub import snapshot_download
if __name__ == "__main__":
mineru_patterns = [
"models/Layout/LayoutLMv3/*",
# "models/Layout/LayoutLMv3/*",
"models/Layout/YOLO/*",
"models/MFD/YOLO/*",
"models/MFR/unimernet_small_2501/*",
"models/TabRec/TableMaster/*",
"models/TabRec/StructEqTable/*",
"models/MFR/unimernet_hf_small_2503/*",
# "models/TabRec/TableMaster/*",
# "models/TabRec/StructEqTable/*",
]
model_dir = snapshot_download(
"opendatalab/PDF-Extract-Kit-1.0",
......
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