You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I measured the processing time for OCR by executing the following code.
The execution results are as follows, and the processing time is about 5 times longer when executed with multiprocessing.
I would like to know why the time is getting longer and what to do about it.
Can someone please help me?
Processing time of OCR: 1.1000 [sec]
OCR Result: The difficult thing in the life is
Processing time of OCR: 5.5675 [sec]
OCR Result: The difficult thing in the life is
import time
import multiprocessing
from multiprocessing import Process
#paddle OCR
from paddleocr import PaddleOCR
def normalEntry():
processes = []
p = Process(target=OCR_runnable, args=())
processes.append(p)
p.start()
for process in processes:
process.join()
def OCR_runnable():
ocr = PaddleOCR(use_angle_cls=False, lang='en', show_log=False)
start_time = time.time()
result = ocr.ocr("./test.png", cls=False)
end_time = time.time()
elapsed_time = end_time - start_time
print(f"Processing time of OCR: {elapsed_time:.4f} [sec]")
print("OCR Result: " + result[0][0][1][0])
if __name__ == '__main__':
multiprocessing.freeze_support()
OCR_runnable()
normalEntry()
I measured the processing time for OCR by executing the following code.
The execution results are as follows, and the processing time is about 5 times longer when executed with multiprocessing.
I would like to know why the time is getting longer and what to do about it.
Can someone please help me?
Processing time of OCR: 1.1000 [sec]
OCR Result: The difficult thing in the life is
Processing time of OCR: 5.5675 [sec]
OCR Result: The difficult thing in the life is
Originally posted by @FRAki73 in #14221
The text was updated successfully, but these errors were encountered: