test_images -
which contains testing images.
result -
it contains JSON object file which contains extracted information.
model -
it contains our Faster RCNN model for detecting card images.
id_card_detail_extract.py -
the file will detect the card from the image, crop it and perform required text extraction from the image and save the output in ``result`` folder in JSON format.
id_card_detection_camera.py -
this file can be used to detect card in a live video stream through from a primary camera source.
test_images
folder and pass in the path of the image to variable name IMAGE_NAME
and image_path
.output_path
. result
folder.Tested on Python 3.6.9
To install the requirements.
pip install -r requirements.txt
Runs the application with the default webcam. (To detect ID card in live video stream)
python3 id_card_detection_camera.py
Runs the application with the image file. Default image file "test_images/image1.jpg".
python3 id_card_detail_extract.py
Task | Time | Ram Usage |
---|---|---|
Text detection with faster RCNN | 5.97 seconds | 0.74 GB |
Cropping the image (And if not displaying the cropped image) | 0.09 seconds | 0.74 GB |
Extracting text with OCR and saving in JSON | 0.08 seconds | 0.74 GB |
Total time taken by Entire code | 6.92 seconds | 0.74 GB |
(The above steps were implemented for extracting Information from Aadhar Card and the model works well for it)
namedb1.csv
file could be used to check whether the name of person whose Aadhar Card is being scanned is present in our database or not.