Тёмный

PaddleOCR Python Demo  

Rithesh Sreenivasan
Подписаться 13 тыс.
Просмотров 25 тыс.
50% 1

In this video I demonstrate using a google collab notebook how Optical Character Recognition(OCR) can be done on images using PaddleOCR. PaddleOCR aims to create multilingual, awesome, leading, and practical OCR tools that help users train better models and apply them into practice.
If you like such content please subscribe to the channel here:
ru-vid.com...
If you like to support me financially, It is totally optional and voluntary. Buy me a coffee here: www.buymeacoffee.com/rithesh
Relevant Links:
github.com/PaddlePaddle/Paddl...
colab.research.google.com/dri...

Опубликовано:

 

9 авг 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 94   
@kaitaojiang5839
@kaitaojiang5839 Год назад
Nice work! PaddleOCR is a very convenient tools for multi OCR tasks
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Thank You
@littletomatomonkeysmeeeeel8324
Great work! Helps a lot!👍
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Thank You
@user-lz7ym5qs6w
@user-lz7ym5qs6w Год назад
Thanks for sharing! At present, we have used PaddleOCR in actual business. We found that PaddleOCR performs well in Chinese and English recognition, but it has poor effect on handwritten character recognition.
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Yes handwritten text is challenging
@kaitaojiang5839
@kaitaojiang5839 Год назад
@@RitheshSreenivasan yes, especially for Chinese handwritten recognition,
@ramiyengar1
@ramiyengar1 Год назад
Good work! I am after a OCR solution for extracting specific data from receipts. Have you developed a script for that or can PaddleOCR do it?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Check and see if you can use paddleocr
@rashmikasaha2874
@rashmikasaha2874 4 месяца назад
does this work only on invoices? or will it work on other images like id cards as well? do i need to train it specifically for that?
@RitheshSreenivasan
@RitheshSreenivasan 4 месяца назад
you need to test and see
@harshalpal8564
@harshalpal8564 Год назад
Will Paddle OCR do well on text which have angled orientation?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
You have to check for yourself. I have not tried it. Any OCR should have a skew correction package
@incameet
@incameet Год назад
Why the paper says PP-OCR is "Ultra Lightweight"? What does that mean? Mean much faster than other existing OCR based methods? If so, how much faster?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Please refer to the paper and you will get your answers
@incameet
@incameet Год назад
@@RitheshSreenivasan just read the paper. I think ultra lightweight means it has small footprint.
@carolinardc96
@carolinardc96 Год назад
Can PaddleOCR handle pdfs too? It's been impossible for me to make it work with them.
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Please check their GitHub page
@Jim-hn8hd
@Jim-hn8hd Год назад
Whenever I use the draw_ocr method, I get this " TypeError: '
@RitheshSreenivasan
@RitheshSreenivasan Год назад
I am not sure why you are getting this error. Looks to be an issue with how parameters are passed to this method. May be you can debug line by line
@mayurdangar3804
@mayurdangar3804 Год назад
@@RitheshSreenivasan you need to user result[0] , there might be one more level into the results.
@vidhyashree5359
@vidhyashree5359 10 месяцев назад
Even am getting same error
@urbandancesquad2
@urbandancesquad2 8 месяцев назад
Hello, Thank you for your work and explanations. I would want to transform students’ handwritten paper copies into text files that could be processed with ms Word for example. What do you suggest to get the best recognition, please ?
@RitheshSreenivasan
@RitheshSreenivasan 8 месяцев назад
GPT-4V has good ocr. You can try it with OpenAI API. On open source side Paddle OCR seems to be good
@shadabsheikh3859
@shadabsheikh3859 Год назад
Hi Rithesh, do you know how to set the font_path in the im_show = draw_ocr line?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
I have explained about the fonts in the video. I only know of that method
@renantrevisan2406
@renantrevisan2406 3 месяца назад
On Windows: C:/Windows/Fonts/Arial.ttf
@venkatesanr9455
@venkatesanr9455 2 года назад
Thanks for the videos. Can you discuss on huggingface NER/ Top2vec and search engine possibilities using NER tags. Useful links will be helpful.
@RitheshSreenivasan
@RitheshSreenivasan 2 года назад
Ok
@ram_rahim_creations_officials
@ram_rahim_creations_officials 9 месяцев назад
Thank you for sharing with us... :) I have borderless table format(some columns may have data some not ) data in the PDF files, Can we convert extracted data into table format (rows and columns) using the paddle?
@RitheshSreenivasan
@RitheshSreenivasan 9 месяцев назад
I have not worked with paddle in a long time. Do check their GitHub or raise an issue there
@ram_rahim_creations_officials
@ram_rahim_creations_officials 9 месяцев назад
@@RitheshSreenivasan Thank you.
@rishisharath6668
@rishisharath6668 11 месяцев назад
How could i now train a model to recognise one type of document more accurately?
@RitheshSreenivasan
@RitheshSreenivasan 11 месяцев назад
It has been a long time since I made this video. Your best bet is paddleocr github. Check there or raise a query there
@nomuchohan
@nomuchohan 9 месяцев назад
can you please share how to use PPstructure from paddlepaddle to detect trables and recognize the layout and everything. Thank you.
@RitheshSreenivasan
@RitheshSreenivasan 8 месяцев назад
I have not worked on Paddle for more than a year now. Refer to their GitHub
@narijami
@narijami Год назад
Hello. Thank you for the nice video. Unfortunately, I can not install google.colab, Is there an alternative for that? I have MAC M1
@RitheshSreenivasan
@RitheshSreenivasan Год назад
You need not install google collab. It is a web application from google
@narijami
@narijami Год назад
@@RitheshSreenivasan Thank you. I have another question. In my photos, I may have angled texts, vertical ones and ... How this model detect those cases?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
You have to check for yourself
@vimalaug15
@vimalaug15 Месяц назад
need to more about table structure recognition
@shreyasmagajikondi7838
@shreyasmagajikondi7838 4 месяца назад
were we will get font path ,were should we download that font
@RitheshSreenivasan
@RitheshSreenivasan 4 месяца назад
Look at Linux system paths for font
@LezZeppelinFanPage-nm1ly
@LezZeppelinFanPage-nm1ly 3 месяца назад
Can you make a step by step. I really want to learn but do not know where you are installing. Is it in Command Prompt?
@RitheshSreenivasan
@RitheshSreenivasan 3 месяца назад
It is in a colab notebook
@masoudparpanchi505
@masoudparpanchi505 Год назад
Thanks
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Thank You!
@user-mm7gj4gs5g
@user-mm7gj4gs5g Год назад
Hello, last week the notebook was running properly. Same notebook I runned now, gives me error as in 'Can not import paddle core while this file exists: /usr/local/lib/python3.10/dist-packages/paddle/fluid/libpaddle.so' Please help
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Looks like some installation or library change issues. Try a fresh install of paddle. If it does not work raise a issue on paddle GitHub. The authors of the library are the best people for providing a solution
@raghavsharma4398
@raghavsharma4398 10 месяцев назад
@@RitheshSreenivasan even in colab also it gives the same
@RitheshSreenivasan
@RitheshSreenivasan 10 месяцев назад
@@raghavsharma4398 Contact the authors on Github
@shadabdulsamad9205
@shadabdulsamad9205 5 месяцев назад
which OCR engine is the best for handwriting recognition ?
@RitheshSreenivasan
@RitheshSreenivasan 5 месяцев назад
I find paddle ocr to be good
@shadabdulsamad9205
@shadabdulsamad9205 5 месяцев назад
@RitheshSreenivasan can paddle ocr recognize handwriting on whiteboad ? we are building an OCR to convert the handwriting on the whiteboard into machine text, TrOCR is good, but it can't take large images, so what would you recommend ?
@RitheshSreenivasan
@RitheshSreenivasan 5 месяцев назад
Try and see
@bharathbarakam5702
@bharathbarakam5702 3 месяца назад
Nice video. But there'a a small but major error when trying to debug. For the #draw ocr code, the result value we will be using should point to result[0] before storing the values for boxes, txts and scores!!
@elunicoodiseo
@elunicoodiseo 3 месяца назад
Thanks!
@kartikkatoch2097
@kartikkatoch2097 4 месяца назад
How to select the font path?
@RitheshSreenivasan
@RitheshSreenivasan 4 месяца назад
I looked up at the font paths in Linux and provided that font path. Google for the same
@harshavardhanachyuta2055
@harshavardhanachyuta2055 Год назад
Google colab session is crashing can i know the reason for this ?? Do i need to upgrade to colab pro for using this ?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
No need . There could be some other issue . Is it a GPU instance?
@harshavardhanachyuta2055
@harshavardhanachyuta2055 Год назад
@@RitheshSreenivasan yes
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Just check for other issues
@senthilkumarnadarajan2247
@senthilkumarnadarajan2247 Год назад
Can you do a video for paddle lite for mobile?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
I will checkout
@DivyaSharma-oq7up
@DivyaSharma-oq7up Год назад
getting this error "AttributeError: module 'paddle.fluid.core_avx' has no attribute 'is_compiled_with_rocm'" on this line "ocr = PaddleOCR (use_angle_cls=True, lang='en')"
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Put this error in their GitHub issues list. May be you will get a resolution
@user-el9fx6gz2s
@user-el9fx6gz2s Год назад
Thanks alot. but I try to run this code on google colab and it gives me an error. can I ask you to help me? ---> 10 im_show = draw_ocr(image, boxes, txts, scores, font_path='BNazanin.ttf') 11 im_show = Image.fromarray(im_show) 12 im_show.save('result.jpg') /usr/local/lib/python3.10/dist-packages/paddleocr/tools/infer/utility.py in draw_ocr(image, boxes, txts, scores, drop_score, font_path) 380 box_num = len(boxes) 381 for i in range(box_num): --> 382 if scores is not None and (scores[i] < drop_score or 383 math.isnan(scores[i])): 384 continue TypeError: '
@samantsagar3845
@samantsagar3845 7 месяцев назад
Did you get any solution for this error?
@souvickdas5564
@souvickdas5564 2 года назад
Please give explanation of this following paper : Defect Prediction With Semantics and Context Features of Codes Based on Graph Representation Learning
@RitheshSreenivasan
@RitheshSreenivasan 2 года назад
Let me see if I can understand the paper
@souvickdas5564
@souvickdas5564 2 года назад
@@RitheshSreenivasan If you are interested we can work on this together.
@littletomatomonkeysmeeeeel8324
I found PaddleOCR works great for document images, but less mature in street scenarios.
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Ok. Good to know
@harshavardhanachyuta2055
@harshavardhanachyuta2055 Год назад
Can you make a video on post processing of ocr like extracting information from the text like extracting invoice number
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Ok let me try
@harshavardhanachyuta2055
@harshavardhanachyuta2055 Год назад
@@RitheshSreenivasan hey bro it really helped me thanks for the video. If possible can you suggest me a way for doing post processing ?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Depends on what information you want to extract. You can use heuristic rules or search terms and then location of bounding box to extract information. This will vary from use case to use case
@harshavardhanachyuta2055
@harshavardhanachyuta2055 Год назад
@@RitheshSreenivasan yes as you said if we use condition wise comparision then we need to write logic for all the different pdfs. so i want to build model such that it recognizes for example date,invoice number irrespective of the layout
@RitheshSreenivasan
@RitheshSreenivasan Год назад
It is difficult in practice to write such a model. You can make use of some lookups
@bharathbarakam5702
@bharathbarakam5702 3 месяца назад
Hi Rithesh! Nice work, I have tried replicating the same steps on my end, but I get the following error when I run this line of code: from PIL import Image, ImageDraw, ImageFont image = Image.open(img_path).convert('RGB') boxes = [line[0] for line in result] txts = [line[1][0] for line in result] scores = [line[1][1][0] for line in result] font = ImageFont.load_default() im_show = draw_ocr(image, boxes, txts, scores,font_path='/usr/share/fonts/truetype/humor-sans/Humor-Sans.ttf' ) im_show = Image.fromarray(im_show) im_show.save('result.jpg') Here goes the error: 385 box_num = len(boxes) 386 for i in range(box_num): --> 387 if scores is not None and (scores[i] < drop_score or 388 math.isnan(scores[i])): 389 continue TypeError: '
@RitheshSreenivasan
@RitheshSreenivasan 3 месяца назад
Looks like a bug in their code. You can open this file in your local installation and convert str to int
@bharathbarakam5702
@bharathbarakam5702 3 месяца назад
@@RitheshSreenivasan Thanks for the response. Figured out the issue, there'a a small error which can be major when trying to debug. For the #draw ocr code, the result value we will be using should point to result[0] before storing the values for boxes, txts and scores.
@shubhmehta4035
@shubhmehta4035 Год назад
TypeError Traceback (most recent call last) Cell In[43], line 15 13 image = Image.open(img_path).convert('RGB') 14 boxes = [line[0] for line in result] ---> 15 txts = [line[1][0] for line in result] 16 scores = [line[1][1] for line in result] 17 im_show = draw_ocr(image, boxes, txts, scores) Cell In[43], line 15, in (.0) 13 image = Image.open(img_path).convert('RGB') 14 boxes = [line[0] for line in result] ---> 15 txts = [line[1][0] for line in result] 16 scores = [line[1][1] for line in result] 17 im_show = draw_ocr(image, boxes, txts, scores) TypeError: 'float' object is not subscriptable Hello, I am not able to resolve this error and have no clue why this keeps on happening. I am working on Jupyter Notebook. Can you please help?
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Book a session on my Topmate link or refer to the PaddleOCR documentation
@abhishekg4147
@abhishekg4147 Год назад
Error: Can not import paddle core while this file exists: /usr/local/lib/python3.10/dist-packages/paddle/fluid/libpaddle.so why is this error coming
@RitheshSreenivasan
@RitheshSreenivasan Год назад
Raise an error on their github. Something to do with how you have installed paddle
@Abhishekkumar-wn9do
@Abhishekkumar-wn9do 11 месяцев назад
i am also geting same error i used your colab notebook exactly ame still same error
@RitheshSreenivasan
@RitheshSreenivasan 11 месяцев назад
@@Abhishekkumar-wn9do This code was written a year ago. meanwhile there would be library changes might have happened So Raise an error on their github. Something to do with how you have installed paddle
@Abhishekkumar-wn9do
@Abhishekkumar-wn9do 11 месяцев назад
ok@@RitheshSreenivasan
@mohammedmuzammilkhan3043
@mohammedmuzammilkhan3043 11 месяцев назад
I too have the same error lets update it hear if we have a solution to this
Далее
Image Recognition with LLaVa in Python
10:56
Просмотров 7 тыс.
Training Tesseract 5 for a New Font
17:24
Просмотров 40 тыс.
SHAP with Python (Code and Explanations)
15:41
Просмотров 55 тыс.