PAN-Card-OCR icon indicating copy to clipboard operation
PAN-Card-OCR copied to clipboard

AttributeError: 'filter' object has no attribute 'split'

Open Alkeshm29 opened this issue 8 years ago • 18 comments

lines = text.split('\n') AttributeError: 'filter' object has no attribute 'split'

how to solve this error

Alkeshm29 avatar Dec 07 '17 07:12 Alkeshm29

What I had done there that If I grab text from image so it will return like paragraph now we have to process on each and every line of that paragraph so that's why I use "lines = text.split('\n')".

dilippuri avatar Dec 07 '17 08:12 dilippuri

I get none value

Alkeshm29 avatar Dec 14 '17 07:12 Alkeshm29

put 'print text' statement before "lines = text.split("\n")" and check what you get. Actually, I am assuming that information comes in different lines

dilippuri avatar Dec 14 '17 19:12 dilippuri

I git cloned your project and ran in cmd E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src>C:\Python27\python.exe crop_morphology.py test.jpg

It gives error as too many values to unpack

shahnawaj5488 avatar Mar 16 '18 07:03 shahnawaj5488

Then I gave only path as the second argument and now there is no error but can't see any output, the src folder contains five test images

C:\Python27\Scripts>E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\crop_morphology.py E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src

shahnawaj5488 avatar Mar 16 '18 07:03 shahnawaj5488

C:\Python27\Scripts>E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\crop_morphology.py E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\test.jpg

try this one and see

dilippuri avatar Mar 16 '18 17:03 dilippuri

By giving this,

C:\Python27\Scripts>E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\crop_morphology.py E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\test.jpg Still E:\PAN-Card-OCR-master\PAN-Card-OCR-master\src\test.jpg too many values to unpack

shahnawaj5488 avatar Mar 19 '18 07:03 shahnawaj5488

Brother can I get the step by step way to execute as this is an important project for me

shahnawaj5488 avatar Mar 19 '18 07:03 shahnawaj5488

let me know what do you wanna do?

there is no need to use crop_morphology.py in case you are extracting text from image

dilippuri avatar Mar 20 '18 06:03 dilippuri

I want to get the name, DOB, pan number from pan card as a string. Similarly for the Driving License and Aadhaar card. Can you please share your email id at [email protected]

shahnawaj5488 avatar Mar 21 '18 07:03 shahnawaj5488

Bro Please help with your email id at [email protected] as tried a lot but things are not great.Need help asap.That would be great.

shahnawaj5488 avatar Mar 29 '18 14:03 shahnawaj5488

Hi Shahnawaz/Dilip,

I am working on same project, Could you please help me to execute this project.

pritesh-tiwari avatar Jul 08 '18 10:07 pritesh-tiwari

I thought I need to work on it. The first thing is that modularization of the program. A complete change in logic and dependencies. Tackle the problem in a much better way.

@Alkeshm29 @shahnawaj5488 @pritesh-tiwari

Please help. What kinds of problems you got and how you tackle them? Suggestions would be appretiated.

dilippuri avatar Jul 08 '18 12:07 dilippuri

Hi Shahnawaz/Dilip,

I am working on same project, Could you please help me to execute this project, as I am facing the same issues as Shahnawaz faced, please help me out asap.

vishalsahu215 avatar Oct 15 '18 13:10 vishalsahu215

any solution for this issue??

I am facing the same issue!

AmitKKhanchandani avatar Dec 19 '18 10:12 AmitKKhanchandani

I thought I need to work on it. The first thing is that modularization of the program. A complete change in logic and dependencies. Tackle the problem in a much better way.

@Alkeshm29 @shahnawaj5488 @pritesh-tiwari

Please help. What kinds of problems you got and how you tackle them? Suggestions would be appretiated.

@dilippuri can you share your approach on the logic, how you are gonna solve this? I am also stuck with the AttributeError: 'filter' object has no attribute 'split' and looking around the solution for this.

any help will be highly helpful on solving and building this project.

AmitKKhanchandani avatar Dec 20 '18 07:12 AmitKKhanchandani

@dilippuri Hi Dear, I need to read PAN CARD, ADHAR CARD AND VOTERID CARD and save this data in a csv file or database file. Please help me on this. I will be greatful to you. I am using your code but getting this error: Traceback (most recent call last): File "tpan.py", line 62, in lines = text.split('\n') AttributeError: 'filter' object has no attribute 'split'

Please help. I am in difficult situation.

pcplws avatar Jul 11 '20 08:07 pcplws

add this line. it should work if using python3. text = list(filter(lambda x: ord(x) < 128, text)) text = ' '.join([str(s) for s in text])

antiksaini avatar Dec 29 '21 17:12 antiksaini