0

I have converted a pdf into a image and converting into arrays.
However its taking too much time or almost kernel dead during this process and at the end getting empty o/p.

How to handle this issue. kindly suggest.

Code:

images = convert_from_path('abc.pdf',poppler_path= r'C:\Program Files (x86)\poppler-0.68.0\bin')

final=[]
    for i in range(len(images)):    bounds=reader.readtext(np.array(images[i]),min_size=0,slope_ths=0.2,ycenter_ths=0.7,height_ths=0.6,width_ths=0.8,decoder='beamsearch')
final.append(bounds)

Here the o/p of the above code is empty : []

What I've tried:
Without using a loop , if I just give image[0] or image[1] etc, then I see the desired o/p result.

VC.One
  • 14,790
  • 4
  • 25
  • 57
Trend
  • 1
  • 1
  • 4
  • It worked with the latest now.. but now when trying to convert into text , the iteration isnt working i.e. i am unable to convert into text .. code: final=[] for i in range(len(images)): final.append(reader.readtext(np.array(images[i]),min_size=0,slope_ths=0.2,ycenter_ths=0.7,height_ths=0.6,width_ths=0.8,decoder='beamsearch')) text='' for i in range(len(bounds)): text=text+bounds[i][1]+'\n' print(text) – Trend Feb 24 '22 at 06:19
  • A kernel can automaticlly die if the process doesnt have enough ram to consume, make sure you have enough memory. You could control the dpi of the images to reduce ram usage and lower the image quality. – Salman.S Aug 05 '22 at 17:26

0 Answers0