Skip to content

Flask app to extract number, name, dob, gender using YOLO detection model and pytesseract OCR

Notifications You must be signed in to change notification settings

alpha74/aadhar-ocr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Aadhar OCR

  • Upload Aadhar card image and get aadhar details in the response.
  • Using YOLO model and Tesseract ocr

Run

  • Install packages in venv using requirements.txt
  • Create folder uploads in same folder level as app.py.
  • Add model file photo.pt in same folder level as app.py
  • Flask run command python app.py.

APIs

Server health

curl --location 'http://127.0.0.1:5000/hello/'
Response
{
    "message": "Hello"
}

Get aadhar number from file

curl --location 'http://127.0.0.1:5000/aadhar/' \
--form 'file=@"1.jpeg"'
Response
  • detectPhoto signifies if YOLO model was able to detect photo or not.
  • The flow works first by detecting a face - which is from the photo. Without its value as True, the aadhar number detection flow will not work.
200 OK
{
    "aadharNumber": "4909XXXXXXXX",
    "detectPhoto": True,
    "dob": "26/12/19XX",
    "gender": "male",
    "message": "Success",
    "name": "Johnny Bravo"
}
  • Other status codes: 400, 500

About

Flask app to extract number, name, dob, gender using YOLO detection model and pytesseract OCR

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages