Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
363 views
in Technique[技术] by (71.8m points)

python 3.x - Efficient way to implement multiprocessing or multi threading when image is divided into smaller grid and implementing text detection over each grid?

Divided the single images into 10X10 grid On each grid, I need to implement text detection and get the results using tesseract. when I implement threads my CPU goes to 100% usage until this whole task is done and I get variation in response time if I call this program again and again. what is the efficient way to reduce cpu usage and results

for i in range(0,11):
     gridCol = gridCol[1:] +[i]
     #print("In Loop gridCol = ",gridCol)
     gridRow = startGridRow
     for j in range(0,11):
       gridRow = gridRow[1:] +[j]
       #print("In Loop gridRow = ",gridRow)
       total_grid.append([gridRow,gridCol])

for grid in total_grid:
   threads = threads + [self.executor.submit(self.textdetections, (grid[1],grid[0])])
question from:https://stackoverflow.com/questions/65939942/efficient-way-to-implement-multiprocessing-or-multi-threading-when-image-is-divi

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...