{"id":25684712,"url":"https://github.com/kudzaiprichard/passport-verification-api","last_synced_at":"2026-04-11T19:07:03.731Z","repository":{"id":189206596,"uuid":"666104821","full_name":"kudzaiprichard/passport-verification-api","owner":"kudzaiprichard","description":"Passport document verifications using machine learning python sklearn","archived":false,"fork":false,"pushed_at":"2023-10-14T22:20:34.000Z","size":316987,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-10-16T04:59:11.491Z","etag":null,"topics":["flask","flask-sqlalchemy","image-forgery-detection","image-processing","image-recognition","juypter-notebook","machine-learning","python","rest-api","scikit-learn","sklearn","sql","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kudzaiprichard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-13T18:12:11.000Z","updated_at":"2023-09-20T12:25:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"946c1515-70f0-4d24-a1d5-d4abcd5dd900","html_url":"https://github.com/kudzaiprichard/passport-verification-api","commit_stats":null,"previous_names":["kudzaiprichard/passport-verification-api"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kudzaiprichard%2Fpassport-verification-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kudzaiprichard%2Fpassport-verification-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kudzaiprichard%2Fpassport-verification-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kudzaiprichard%2Fpassport-verification-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kudzaiprichard","download_url":"https://codeload.github.com/kudzaiprichard/passport-verification-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240524211,"owners_count":19815237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-sqlalchemy","image-forgery-detection","image-processing","image-recognition","juypter-notebook","machine-learning","python","rest-api","scikit-learn","sklearn","sql","sqlite"],"created_at":"2025-02-24T17:32:33.702Z","updated_at":"2025-12-30T21:07:30.475Z","avatar_url":"https://github.com/kudzaiprichard.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/kudzaiprichard/realestate-backend\"\u003e\n    \u003cimg src=\"images/logo/Passport.png\" alt=\"Logo\" width=\"800\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003ePassport Verification Api\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A restful Api for verifying passport \n    \u003cbr/\u003e\n  \u003c/p\u003e\n  \u003cbr/\u003e\n\u003c/div\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#project-scope\"\u003eProject Scope\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#project-design\"\u003eProject Design\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n# About The Project\n\n### Project Scope\n\nThe API verifies the authenticity of passports by checking against global databases, ensuring that you have access to \naccurate and up-to-date information. Integrate the API into your existing onboarding workflow to streamline your verification \nprocess, reduce errors, and improve your operational efficiency.\n\nSystem uses a simple flask restfull api.It only stores users registration data for authentication and \nprocesses the passport. Then it returns the passport data and if It's valid or not. \nThe passport goes through two layers of processing:\n\n* image forgery detection \n* `passport eye` passport details verification\n\n## Project Design\n\n### Architecture\nSystem uses a restfull api to share its resources. `But what is a rest API?`\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"images/rest.webp\" alt=\"architecture Diagram\" \u003e\n\u003c/div\u003e\n\nREST (Representational State Transfer) is an architectural style that defines a set of constraints for creating web services. \nREST API is a type of web service that is designed to interact with resources on the web, such as web pages, files, or other data. \nIn the illustration below, we are showing how different types of applications can access a database using REST API.\n\n### Endpoint Design\nBelow is a screenshot of the project restful api endpoints and the HTTP Method supported by each endpoint\n\n| Method | resource                           |\n|--------|------------------------------------|\n| POST   | api/v1/auth/register               |\n| POST   | api/v1/auth/authenticate           |\n| POST   | /api/v1/document/validate/passport |\n\n### How does the verification work?\nWhat is passport Eye?\n\nThe package provides tools for recognizing machine-readable zones (MRZ) from scanned `identification documents`. \nThe documents may be located rather arbitrarily on the page. The code tries to find anything resembling a `MRZ` and parse it from there.\n\nWhat is MRZ?\n\nMachine-Readable Zone `MRZ` is a codified element of identity documents. Its purpose is to `facilitate` easier automated \nscanning of basic personal details of the document holder, such as their `full name`, `document number`, `nationality`, `date of\nbirth`, and the document `expiration date`.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"images/mrz_output_04.jpg\" alt=\"CloneDetection\"\u003e\n\u003c/div\u003e\n\n\u003e Above diagram shows passport Eye MRZ output\n\nWhat is image forgery detection?\n\nImage forgery detection can mainly be divided into two categories: active and passive. Sometimes these methods also give \na localization of the altered/forged areas of the image, and even provide an estimate of the original visual content\n\nHow does image forgery work?\n* `Error Level Analysis`. Manipulation attempts are detected by comparing compression quality between different areas of the image.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"images/ErrorLevelAnalysis1.jpg\" alt=\"CloneDetection\"\u003e\n\u003c/div\u003e\n\n* `Clone Detection`. Cloning, copying and pasting of certain objects or areas in the image is detected with scaling and rotation support.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"images/CloneDetection.jpg\" alt=\"CloneDetection\"\u003e\n\u003c/div\u003e\n\n* `Quantization Table Analysis`. Digital cameras and PC-based image editing tools use different quantization tables when saving encoding images into JPEG \nformat. Quantization tables can be extracted and analyzed. If the tables are different from those used by the camera model as specified in the image's EXIF information, then a manipulation attempt is present.\n\n\n* `Double Compression Artifacts`. JPEG is a lossy compression format, meaning that certain artifacts are introduced every time an image is saved. By opening,\nediting and saving a JPEG picture, one inevitably introduces compression artifacts that were not present in the original JPEG. \nAs certain correlation of neighboring pixels is only present in JPEG images when they are opened and compressed again, \nit becomes possible to detect these artifacts and bring investigator's attention to the altered image.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"images/2-Figure2-1.png\" alt=\"CloneDetection\"\u003e\n\u003c/div\u003e\n\n\u003e Above diagram shows Double Compression Artifacts\n\u003e \n### Built With\nUsed `python` , `flask`, `tensorflow`, `keras` and  `Jason Web Token` to build the rest api, including `postman` for testing.\n\n\u003cdiv\u003e\n   \u003cimg src=\"https://github.com/get-icon/geticon/raw/master/icons/python.svg\" alt=\"Python\" width=\"40px\" style=\"margin-right: 20px;\"\u003e\n   \u003cimg src=\"images/logo/flask.svg\" alt=\"Python\" width=\"33px\" style=\"margin-right: 20px;\"\u003e\n   \u003cimg src=\"images/logo/tensorflow-svgrepo-com.svg\" alt=\"Python\" width=\"40px\" style=\"margin-right: 20px;\"\u003e\n   \u003cimg src=\"images/logo/jwt-3.svg\" alt=\"Python\" width=\"40px\" style=\"margin-right: 20px;\"\u003e\n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\n### Prerequisites\n\nYou should have the below software installed in your pc :\n* Python3\n* Anaconda\n* Tesseract OCR\n* and your preferred IDE or text editor\n\n\n### Installation\n\n1. Get a free API Key at [https://github.com/settings/tokens](https://github.com/settings/tokens)\n2. Clone the repo\n\n   ```sh\n   git clone https://github.com/kudzaiprichard/passport-verification-api\n   ```\n3. Open project in desired IDE or text editor\n4. Create a python environment\n    ```shell\n    python -m venv myenv\n    ```\n   \n5. Activate created environment\n    ```shell\n    source myenv/bin/activate\n    ```\n   \n6. Install required python packages\n    ```shell\n    pip install -r requirements.txt\n    ```\n   \n7. You can now run the system using below flask command\n    ```shell\n    flask run\n    ```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!--CONTRIBUTING--\u003e\n## Contributing\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n### :fire: Contribution\n\nYour contributions are always welcome and appreciated. Following are the things you can do to contribute to this project.\n\n1. **Report a bug** \u003cbr\u003e\n   If you think you have encountered a bug, and I should know about it, feel free to report it [here]() and I will take care of it.\n\n2. **Request a feature** \u003cbr\u003e\n   You can also request for a feature [here](), and if it will viable, it will be picked for development.\n\n3. **Create a pull request** \u003cbr\u003e\n   It can't get better than this, your pull request will be appreciated by the community. You can get started by picking up any open issues from [here]() and make a pull request.\n\n\u003e If you are new to open-source, make sure to check read more about it [here](https://www.digitalocean.com/community/tutorial_series/an-introduction-to-open-source) and learn more about creating a pull request [here](https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- LICENSE --\u003e\n## License\n\n\u003e Distributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\n\u003e Kudzai P Matizirofa - [linkedin.com/in/kudzai-prichard](https://linkedin.com/in/kudzai-prichard) - \u003ckudzaiprichard@gmail.com\u003e\n\nProject Link: [https://github.com/kudzaiprichard/passport-verification-api](https://github.com/kudzaiprichard/passport-verification-api)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\nlist of resources I found helpful and would like to give credit to.\n\n* [Choose an Open Source License](https://choosealicense.com)\n* [Image forgery detection kaggle](https://www.kaggle.com/code/vishalramanthan/image-forgery-detection)\n* [Python3 documentation](https://docs.python.org/)\n* [Rest API with flask](https://pythonbasics.org/flask-rest-api/)\n* [Flask Documentation](https://flask.palletsprojects.com/)\n* [GitHub Pages](https://pages.github.com)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkudzaiprichard%2Fpassport-verification-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkudzaiprichard%2Fpassport-verification-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkudzaiprichard%2Fpassport-verification-api/lists"}