SWHL / TrOCR-Formula-Rec

基于TrOCR + UniMER-1M数据集,训练一个小而美的公式识别模型
Apache License 2.0
17 stars 2 forks source link

有测过推理耗时吗,我测试下来和UniMERNet耗时差不多? #3

Closed limaopeng1 closed 3 months ago

SWHL commented 3 months ago

你测的那个?我用的是microsoft/trocr-small-stage1

limaopeng1 commented 3 months ago

用的也是microsoft/trocr-small-stage1,图片是UniMER-Test/cpe/0000000.png

测试generate的耗时,先让模型跑了几次,然后才计算这张图片的推理耗时,这张图片的耗时是2s左右,和UniMERNet差不多,但UniMERNet毕竟是一个差不多4G的模型,这是哪里有问题吗? s3 = time.perf_counter() generated_ids = model.generate(pixel_values) s4 = time.perf_counter()

limaopeng1 commented 3 months ago

UniMERNet用的是这个模型:https://huggingface.co/wanderkid/PDF-Extract-Kit/tree/main/models/MFR/UniMERNet 同张图片耗时大概是2.8s