Skip to content

求助各位大佬们,python调用为什么速度上不去呀? #1029

@hellooldtimes

Description

@hellooldtimes

start = time.perf_counter()
reslutl_text= ocr_api.runBytes(image)
print(f"OCR执行时间: {time.perf_counter() - start:.8f} 秒")
只计算python调用runBytes开始OCR识别到返回结果的时间,原图长宽1500x1300,大小7.43MB的BMP未压缩格式,需要1.22秒左右;然后对原图进行opencv操作(灰度化和二值化等),然后压缩为长宽1500x1300,大小为93kb左右的PNG无损压缩格式,需要0.93秒左右,这大小都压缩成不到100kb了,为什么时间相差不大啊?如果只算OCR识别到返回结果的时间,需要以什么样的姿势调用才能把时间缩短到0.2秒左右(业务需求)😭

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions