DebAI is a cutting-edge, dual-theme AI assistant built with Streamlit. It combines powerful OCR (Optical Character Recognition) capabilities with a sophisticated chat interface, wrapped in a stunning "Ultimate Glassmorphism" UI.
Whether you need to extract text from scanned documents, analyze PDFs, or have a conversation with a local (Ollama) or cloud-based (Gemini) LLM, DebAI handles it with style and precision.
- Local Power: Seamless integration with Ollama for running privacy-focused local models (e.g., Gemma, Llama 3).
- Cloud Fallback: Automatic fallback to Google Gemini when local models are unavailable.
- Smart Language Detection: Automatically detects Hindi and Bengali inputs and instructs the model to respond in the appropriate script.
- Image OCR: Extract text from images (
.png,.jpg,.jpeg) using Tesseract. - PDF Analysis: Read and extract text from multi-page PDF documents.
- Auto-Context: Extracted text is automatically fed into the chat context for immediate analysis.
- Dual Theme: Switch between a Cinematic Dark Mode and a Clean, Airy Light Mode.
- Visuals: Features frosted glass cards, animated backgrounds (
orbFloat), and smooth transitions. - Responsive: Perfectly optimized layout for various screen sizes.
- PDF Export: Download your entire chat session as a formatted PDF report.
- Hotkeys: Quick actions like "Send Last OCR" (Alt+S) for rapid workflows.
- Frontend: Streamlit
- OCR Engine: Tesseract OCR & PyTesseract
- PDF Processing: pdfplumber
- AI Models: Ollama (Local) & Google Gemini (Cloud)
- Report Generation: FPDF
Ensure you have the following installed:
- Python 3.8+
- Tesseract OCR:
- Windows: Download and install the binary. Note the installation path (default:
C:\Program Files\Tesseract-OCR\tesseract.exe).
- Windows: Download and install the binary. Note the installation path (default:
- Ollama (Optional, for local models):
- Install Ollama and pull a model:
ollama pull gemma:2b(or your preferred model).
- Install Ollama and pull a model:
Clone the repository and install dependencies:
git clone https://github.com/DebasmitaBose0/Code-Genie-AI-Team-A-.git
cd Code-Genie-AI-Team-A-
pip install -r requirements.txtDebAI works out-of-the-box with Ollama. To use Google Gemini as a fallback, set your API key:
Windows (PowerShell):
$env:GEMINI_API_KEY="your_api_key_here"Linux/Mac:
export GEMINI_API_KEY="your_api_key_here"(Optional) You can also configure the Tesseract path in AI.py if it differs from the default.
Launch the application using Streamlit:
streamlit run AI.pyThe app will open in your default browser at http://localhost:8501.
- Upload Documents: Use the sidebar or top tabs to upload Images or PDFs.
- Extract Text: The app will automatically extract text. You can choose to send it to the AI immediately or edit/review it.
- Chat: Type your queries in the chat bar. The AI has context of your uploaded documents.
- Switch Themes: Toggle between Light and Dark mode using the button in the top-right corner.
- Export: Click "Download Report (PDF)" in the sidebar to save your conversation.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.