You can easily run this code with Google colab.
This is an application build in Python using OpenCV to detect ID card from a picture, Id card can be placed in any angle dimension and any enviroment. Currently this application works with Pakistan's National ID card, but with a little modification It can work with any sort of card.
Some Results: