Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Azure Intelligent Document OCR

A simple credit card OCR demo built with Python, Streamlit, and Azure Cognitive Services. This application uploads an image to Azure Blob Storage and extracts text using Azure Document Intelligence (OCR).


✅ Features

  • Upload images via browser
  • Store files securely in Azure Blob Storage
  • Perform OCR using Azure Document Intelligence (prebuilt-read)
  • Extract structured text data from images
  • Clean project structure with modular services
  • Environment variables support with .env

🚀 Tech Stack

Component Technology
Frontend Streamlit
OCR AI Azure Document Intelligence
Storage Azure Blob Storage
Runtime Python 3.10+
Config python-dotenv

📂 Project Structure

.
├── src
│   ├── app.py                        # Streamlit frontend
│   ├── services
│   │   ├── blob_service.py           # Upload to Azure Blob
│   │   └── credit_card_service.py    # OCR logic
│   └── utils
│       └── Config.py                 # Env config loader
├── .env                              # Azure credentials (not committed)
├── requirements.txt                  # Python dependencies
└── README.md

🔧 Setup & Installation

1. Clone this repository

git clone https://github.com/yourusername/azure-intelligent-document-ocr.git
cd azure-intelligent-document-ocr

2. Create and activate virtual environment

python -m venv venv
# Windows
venv\Scripts\activate

# Linux/Mac
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

🔐 Environment Variables

Create a .env file in the project root with:

ENDPOINT=https://<your-azure-endpoint>.cognitiveservices.azure.com/
SUBSCRIPTION_KEY=<your-azure-subscription-key>
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=...
CONTAINER_NAME=cartoes

▶️ Run the App

From the root folder:

streamlit run src/app.py

The app will open at: http://localhost:8501


📦 Requirements

  • Python 3.10+
  • Azure subscription
  • Azure Document Intelligence Resource
  • Azure Storage Account + Blob Container

⚠️ Important Notes

  • Do not commit your .env file
  • Azure keys must remain secret
  • Use this demo for educational purposes only

✅ To Do (Roadmap)

  • Extract cardholder name automatically
  • Extract bank/logo using regex and AI
  • Generate structured JSON OCR output
  • Add Azure Form Recognizer prebuilt-layout model

📝 License

This project is licensed under the MIT License.


🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss.


💙 Author

Developed by Daniel Raid

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages