Simple Fast 3-step Python OCR using Deep Learning 40+ Languages

1littlecoder · Beginner ·🧬 Deep Learning ·5y ago
In this video, we learn how to use `easyocr` python package which is a Ready-to-use Optical Character Recognition (OCR) with 40+ languages supported including Chinese, Japanese, Korean and Thai. It uses Pytorch in the backend. The demo is on Google Colab. GPU makes the process faster but not mandatory. It can work on CPU as well. Github: https://github.com/JaidedAI/EasyOCR Notebook - https://github.com/amrrs/youtube-r-snippets/blob/master/Easy_OCR_Character_Recognition_40%2B_Languages.ipynb easyocr currently supports following 42 languages. Afrikaans (af), Azerbaijani (az), Bosnian (bs), Simplified Chinese (ch_sim), Traditional Chinese (ch_tra), Czech (cs), Welsh (cy), Danish (da), German (de), English (en), Spanish (es), Estonian (et), French (fr), Irish (ga), Croatian (hr), Hungarian (hu), Indonesian (id), Icelandic (is), Italian (it), Japanese (ja), Korean (ko), Kurdish (ku), Latin (la), Lithuanian (lt), Latvian (lv), Maori (mi), Malay (ms), Maltese (mt), Dutch (nl), Norwegian (no), Polish (pl), Portuguese (pt),Romanian (ro), Slovak (sk) (need revisit), Slovenian (sl), Albanian (sq), Swedish (sv),Swahili (sw), Thai (th), Tagalog (tl), Turkish (tr), Uzbek (uz), Vietnamese (vi) (need revisit)

What You'll Learn

Builds a simple 3-step Python OCR using EasyOCR and PyTorch to recognize characters from images in 40+ languages

Full Transcript

hey friends welcome to O'Neill recorder in this video we are going to look at a new trending Python package that's called ECU OCR so that as the name suggests that it helps you in recognizing characters from any sort of images and the good thing about this particular package is that it's supposed 40-plus languages that includes Chinese Japanese Korean side and also of course English so if you have mix of language still it can work so currently it supports 42 languages per term if you actually go to the issues and peer you could see a lot of language requests people have added and the developer is working on adding these things so let's get straight into the package and see how we can utilize it the first one is this package is based on PI torch so if you have a GPU it can work very fast but if you do not have a GPU still it can work but it would take a little bit of time so in that case if you do not have GPU you have to explicitly mention that um GP is equal to false but otherwise if you have a GP or if you are using Google collapse so it should work very well we are going to see how to use it so one caveat is that if you are using a Windows machine you have to explicitly first install PI torch and then you have to install this package but if you are using Mac or Linux or any other UNIX environment you don't have to bother about it so let's go ahead and install the install was here so pip install goes here I have not changed my Kolob runtime yet to GPU or will install it once we install it almost like if you have to change the nine-time and before we do that let's change it to GPU and then we'll install it meanwhile let's go ahead and pick an image that we want to do so Excel billboard let's look for pixel real world you can pick this image image location let's open an image location and then you could see okay it opens an image view image so this is the image that we are going to use to do image recognition so let's see the packages been installed bottom due to a mismatch of pillow you have to restart the runtime so let's first restart the runtime once we restart the runtime please remember that we still have we are still we have it in CPU we have to change it to GPU so that this package can work faster thus its own it uses deep learning behind it so you could see that or it is initializing now you have successfully connected to a GPU so let's first call the package was here and see if it works fine oops it is not working fine let us run it once more we have pre-installed it again I think so once we install it it should it's asking you to restart the runtime restart the runtime it's reinitializing once your tree initializers import ez was here hopefully it works on seems it is working so the next function is you have to download the model that you want the way you can do is you can download multiple languages or you can do single language in this case we don't want multiple languages so I will just download English and this is the place where if you have a cheap if you do not have a GPU you are going to say CP is equal to false but by default EB is equal to true so download the language model and then you're going to pick the image but right now in this case we don't have an image so what we are going to do is we are going to first download the image let's download okay it's still downloading once the download completes we can download the image quest you are who live dot request dot she will directly download the image that you want in this case it's the image we don't want these parameters let's just take the chip egg and you want to give the file name that you want file name is equal to let's say I'll say some local file input file input file dot JPEG jpg and uh okay URL retrieve does not have leave us let's check or we can say URL retrieve okay that's called URL let's leave my bad so downloaded so let's check our current working space to see if that file is there if that file is there we can okay the input file is there so now the next thing is let's take the code to just display display HTML image nor curl app it's a small code that I forgot okay so now this was there let us open our input file input file jpg now you know that this is the image okay so now next thing what we are trying to do is we are trying to use the model that we downloaded in this case the English language model and then we are going to parse this image so in this case input file dot jpg so it's the same step for any language um it's not entirely new okay I should have it's very fast if you see it in GPU mode it will be very slow so I'm going to assign it to the result and the result usually as result is a list of lists of lists so you can see their tongue it has three main components one is the bounding box the coordinates for you to make burning but the second one is that and third is the confidence level in which it is predicting so what we need is we just need the tick so what I'm going to say is I'm going to say first then result I have got how many elements output six okay so I'm going to say range of foreign range of mmm trend of result I want every ight iteration I want the third second element actually the third element but it is zero index oops sorry on the first one and then you can see that it says pixel Fourier pixel for a okay let me reduce the zoom of my browser and we can see pixel Fourier the new Google Google phone so yep that is we have successfully used object character recognition for our English language so let's so just to see that maybe if you are lucky or we want to check for some other path billboard so let's see some other build what so let's take some over build war whoops billboard okay let's take this and then find copy image location and go back and give the image hopefully the image gets downloaded without any HTTP error successfully it's downloaded so let's see if the image is really test so it's the latest image so it says AC car writes in five minutes of this and now we are trying to do recognition once that is done we are trying to print the text so AC car rides in five minutes and then there is uber there is uber and you'd say spay with cash or KTM wallet first write free oh it does also recognize the a stick over there use called NCR nine download I think this this this thing has blocked it download the uber app and you can see that play in four uber.com so that is all so available there so it is a very good job of doing the character recognition so you can do it for all these languages that they have listed it is simple three-step load the package download the language model or in this case on the model that you want to use for recognition and then you can pass on the JPEG you can either pass on the JPEG or you can read that image with open CV and also you can no password as a byte file so you can do anything so you can use pillow or you can use open CV or you can just give the image path and then you can just download the model whatever model you want and you get this result beautiful to sit like this um it can be used for any purpose or so as long as you can leverage GPU it is really fast if you do not have GPU it takes a considerable amount of time but still given the coverage that they have got 40-plus languages and you can still see a lot of labels where language request language request there is Greek Gregorian portion thumber so all these language supports are there so it should the coverage should really really increase so if you really like this package please give a star to the developer so that it motivates them and we don't really have a lot of names to thank but what we can probably do is we can see any name that is currently available Ronchetti not have done also thank you for the developer who made it available for us on this optical
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from 1littlecoder · 1littlecoder · 49 of 60

1 How to create your Free Data Science Blog on Github with Fastpages from Fastai
How to create your Free Data Science Blog on Github with Fastpages from Fastai
1littlecoder
2 Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
1littlecoder
3 Create your first Data Science Web App using R Shiny
Create your first Data Science Web App using R Shiny
1littlecoder
4 How to create a Reproducible Example in R using reprex
How to create a Reproducible Example in R using reprex
1littlecoder
5 No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
1littlecoder
6 Scrape HTML Table using rvest and Process them for insights using tidyverse in R
Scrape HTML Table using rvest and Process them for insights using tidyverse in R
1littlecoder
7 Google Teachable Machine Learning Build No Code AI solution
Google Teachable Machine Learning Build No Code AI solution
1littlecoder
8 Create meaningful fake tidy datasets in R using fakir [#rstats Package]
Create meaningful fake tidy datasets in R using fakir [#rstats Package]
1littlecoder
9 How to enable using R Programming with Visual Studio VS Code
How to enable using R Programming with Visual Studio VS Code
1littlecoder
10 Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
1littlecoder
11 Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
1littlecoder
12 Intro to Google Colab - How to use Colab
Intro to Google Colab - How to use Colab
1littlecoder
13 Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
1littlecoder
14 Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
1littlecoder
15 Do you want a career in Data Science - Tamil Webinar
Do you want a career in Data Science - Tamil Webinar
1littlecoder
16 Android Smartphone Analysis in R [Live Coding Screencast]
Android Smartphone Analysis in R [Live Coding Screencast]
1littlecoder
17 Programmatically create Images, Memes, Watermarks using Python with imgmaker
Programmatically create Images, Memes, Watermarks using Python with imgmaker
1littlecoder
18 Kaggle Walkthrough to get you started with Data Science - Webinar
Kaggle Walkthrough to get you started with Data Science - Webinar
1littlecoder
19 Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
1littlecoder
20 Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
1littlecoder
21 Excel to R - Pivot + Bar Chart in Excel  & R using tidyverse [Live Coding]
Excel to R - Pivot + Bar Chart in Excel & R using tidyverse [Live Coding]
1littlecoder
22 Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
1littlecoder
23 5 websites to get Free Real-World Datasets for Data Science/ML Projects
5 websites to get Free Real-World Datasets for Data Science/ML Projects
1littlecoder
24 Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
1littlecoder
25 Correlation-alternative PPS (Predictive Power Score) Python Package Demo
Correlation-alternative PPS (Predictive Power Score) Python Package Demo
1littlecoder
26 Automated Website Screenshots in R using {webshot}
Automated Website Screenshots in R using {webshot}
1littlecoder
27 Installing Custom RStudio Theme (Synthwave85)
Installing Custom RStudio Theme (Synthwave85)
1littlecoder
28 Analyse Google Trends Search Data in R using {gtrendsR}
Analyse Google Trends Search Data in R using {gtrendsR}
1littlecoder
29 3 Tips to ask question on Stack Overflow the right way to get answers
3 Tips to ask question on Stack Overflow the right way to get answers
1littlecoder
30 Learn Data Science with R - Mini Projects - Web Scraping Zomato
Learn Data Science with R - Mini Projects - Web Scraping Zomato
1littlecoder
31 Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
1littlecoder
32 GET Hackernews Front Page Results using REST API in R
GET Hackernews Front Page Results using REST API in R
1littlecoder
33 Quickly deploy ML WebApps from Google Colab using ngrok
Quickly deploy ML WebApps from Google Colab using ngrok
1littlecoder
34 Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
1littlecoder
35 Plotly Interactive Plots as Pandas Plotting Backend df.plot()
Plotly Interactive Plots as Pandas Plotting Backend df.plot()
1littlecoder
36 Stack Overflow Developer Survey 2020 Highlights for New Programmers
Stack Overflow Developer Survey 2020 Highlights for New Programmers
1littlecoder
37 Matplotlib Animation Charts in Python using Celluloid
Matplotlib Animation Charts in Python using Celluloid
1littlecoder
38 Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
1littlecoder
39 Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
1littlecoder
40 Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
1littlecoder
41 Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
1littlecoder
42 Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
1littlecoder
43 ggplot2 Text Customization with ggtext | Data Visualization in R
ggplot2 Text Customization with ggtext | Data Visualization in R
1littlecoder
44 Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
1littlecoder
45 YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
1littlecoder
46 Matplotlib Animated Bar Chart Race in Python | Data Visualization
Matplotlib Animated Bar Chart Race in Python | Data Visualization
1littlecoder
47 Simple Python GUI Development using {guietta}
Simple Python GUI Development using {guietta}
1littlecoder
48 #8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
#8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
1littlecoder
Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
1littlecoder
50 Github New Feature Profile Summary/Mini-Resume - Profile Views
Github New Feature Profile Summary/Mini-Resume - Profile Views
1littlecoder
51 Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
1littlecoder
52 What is OpenAI GPT-3 - Hype, Examples, Worries
What is OpenAI GPT-3 - Hype, Examples, Worries
1littlecoder
53 Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
1littlecoder
54 Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
1littlecoder
55 GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
1littlecoder
56 How to use Advanced Google Search to extract Email Ids from Linkedin
How to use Advanced Google Search to extract Email Ids from Linkedin
1littlecoder
57 Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
1littlecoder
58 Flow - R Package to visualize code logic, functions as a Flow Diagram
Flow - R Package to visualize code logic, functions as a Flow Diagram
1littlecoder
59 Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
1littlecoder
60 Create a Pencil Sketch Portrait with Python OpenCV
Create a Pencil Sketch Portrait with Python OpenCV
1littlecoder

Related AI Lessons

Want to get started with deep learning
Get started with deep learning by leveraging resources like Andrew Karpathy's playlist and frameworks such as TensorFlow or PyTorch
Reddit r/deeplearning
Building a Deepfake Detector From Scratch — What Nobody Tells You
Learn to build a deepfake detector from scratch and understand the challenges involved in detecting AI-generated fake media
Medium · Deep Learning
Unfolding the Meandering Path: High-Dimensional Invariance and the Flat 2D Plane of Neural…
Learn about high-dimensional invariance and its relation to the flat 2D plane of neural networks, and how to apply these concepts to improve model performance
Medium · Deep Learning
Implementing Neural Style Transfer from Scratch: The Project That Started It All
Learn to implement Neural Style Transfer from scratch and understand its significance in deep learning
Medium · Deep Learning
Up next
Image Classification with ml5.js
The Coding Train
Watch →