This Python program verifies the authenticity of Aadhar cards using the Google Vision API. It includes two main functions:
- Extract Text: Extracts text from a list of image paths.
- Classify Aadhar: Classifies whether the extracted text corresponds to a valid Aadhar card.
-
Python 3.x
-
Install dependencies:
pip install -r requirements.txt
export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/service/account/key.json"
from main import extract_text
# Define a list of image paths
image_paths = ["path/to/image1.jpg", "http://example.com/image2.jpg", "path/to/image3.png"]
# Extract text from the images
extracted_texts = extract_text(image_paths)
print("Extracted Texts:", extracted_texts)
from main import classify_aadhar
# Classify the extracted text
result = classify_aadhar(extracted_texts)
print("Classification:", result)
- Ensure the Google Vision API key is correctly set up and accessible.
- Customize the functions based on your specific use case and directory structure.