<jupyter_start><jupyter_text>Upload Image of Aadhar<jupyter_code># For uploading image from local system
#from google.colab import files
#uploaded = files.upload()
#for fn in uploaded.keys():
#  print('User uploaded file "{name}" with length {length} bytes'.format(
#      name=fn, length=len(uploaded[fn])))<jupyter_output><empty_output><jupyter_text>start from here if not upload file.<jupyter_code>#all installing and importing here
import numpy as np
!pip install pytesseract
! apt install tesseract-ocr
! apt install libtesseract-dev
! pip install Pillow
! pip install pytesseract
import pytesseract
from PIL import ImageEnhance, ImageFilter, Image
import cv2 
from google.colab.patches import cv2_imshow
from pytesseract import Output
import re
#getting a random aadhar image
!wget -O 'image.jpg' 'http://www.fakingnews.com/wp-content/uploads/2017/04/lead-smith-adhar-copy-584x403.jpg'
#showing image using opencv
img=cv2.imread('image.jpg')
cv2_imshow(img)
#conversion to text with custom parameters.
custom_config = r'-l eng --oem 3 --psm 3'
txt=pytesseract.image_to_string(img, config=custom_config)
lst=txt.split('\n')
for i in lst:
  if i!='':
    print(i)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup