{"id":15054925,"url":"https://github.com/jyothish-ram/invoice_ocr_api","last_synced_at":"2026-01-05T11:55:28.399Z","repository":{"id":256350786,"uuid":"854589415","full_name":"jyothish-ram/invoice_ocr_api","owner":"jyothish-ram","description":"Invoice OCR Extraction Flask API","archived":false,"fork":false,"pushed_at":"2024-09-10T12:35:55.000Z","size":345,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T18:26:28.390Z","etag":null,"topics":["flask-api","gemma-2b","nlp","ocr","ollama","tensorflow","tesseract"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jyothish-ram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T12:52:03.000Z","updated_at":"2024-10-18T06:10:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d3e967e-44a6-4cce-a973-d7e6663c629f","html_url":"https://github.com/jyothish-ram/invoice_ocr_api","commit_stats":null,"previous_names":["jyothish-ram/invoice_ocr_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyothish-ram%2Finvoice_ocr_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyothish-ram%2Finvoice_ocr_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyothish-ram%2Finvoice_ocr_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyothish-ram%2Finvoice_ocr_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jyothish-ram","download_url":"https://codeload.github.com/jyothish-ram/invoice_ocr_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239126447,"owners_count":19586097,"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-api","gemma-2b","nlp","ocr","ollama","tensorflow","tesseract"],"created_at":"2024-09-24T21:39:12.546Z","updated_at":"2025-10-31T06:30:33.046Z","avatar_url":"https://github.com/jyothish-ram.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoice OCR API\n\nThis project is an OCR data extraction from Invoices or bills. This project utilizes TensorFlow, Pytesseract, Ollama, and Gemma_2b.\n\n## Identifiable parameters\n\n`Company Name`, \n`Company Address`, \n`Customer Name`, \n`Customer Address`, \n`Invoice Number`, \n`Invoice Date`, \n`Due Date`, \n`Description`, \n`Quantity`, \n`Unit Price`, \n`Taxes`, \n`Amount`, \n`Total`\n\n## Working\n\nThis project mainly consists of three parts\n1. Tensorflow Model: this model finds the ROI(region of interest) from the invoice Image. the ROI is given to Tesseract.\n2. Tesseract: Pytessract extracts text from the image(ocr engine).\n3. NLP: Gemma_2b is used with Ollama for NLP which corrects the text extracted by Tesseract \n\n\u003e [!NOTE]\n\u003e - Tensorflow model is stored in `models/saved_model` folder\n\n## Installation\n\n\u003e [!NOTE]\n\u003e - `python3 -m venv venv` to create python virtual env\n\u003e - `./venv/scripts/activate` to activate venv in Windows or `source venv/bin/activate` in Linux\n\u003e - `run pip install -r requirements.txt` to install necessary packages\n\u003e - Need to install Ollama as per Ollama documentation, for Linux `curl -fsSL https://ollama.com/install.sh | sh`\n\u003e - run `ollama run gemma2:2b` to download NLP Gemma_2b model.\n\u003e - run `sudo apt install tesseract-ocr` to install tesseract on Linux machines or for Windows, visit (tesseract for windows)[https://tesseract-ocr.github.io/tessdoc/Compiling.html#windows]\n\u003e - To run the program `python app.py`\n\n### API Request Model\n\nSample API Request Model(POST)\n\u003e - headers:\n```\nContent-Type : application/json\n```\n\n\u003e - body:\n\n```\n    {\n    \"image\": \"{image in base64 Format}\"\n\n    } \n```\n\n### API Response Model\n\nSample API Response:\n\n```\n{\n    \"Company Name\": \"TEMPUSTIC CONSULTORIA TECNOLOGICA SL\",\n    \"Company Address\": \"C/ PIE DE ALTAR N° 7\\n28229 VILLANUEVA DEL PARRDILLO\\nMADRID\",\n    \"Customer Name\": \"SM TECNOLOGIA, S.L.U.\",\n    \"Customer Address\": \"Poligono Industrial Os Airios, Sector 2 - Parcela 4\\n15320 As Pontes\\nA Corufia\",\n    \"Invoice Number\": \"2023.11\",\n    \"Invoice Date\": \"31/05/2023\",\n    \"Due Date\": null,\n    \"Description\": \"Hora Programador Java Junior\",\n    \"Quantity\": 30,\n    \"Unit Price\": 176.00,\n    \"Taxes\": 1108.80,\n    \"Amount\": 5280.00,\n    \"Total\": 6388.80\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjyothish-ram%2Finvoice_ocr_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjyothish-ram%2Finvoice_ocr_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjyothish-ram%2Finvoice_ocr_api/lists"}