How nithyasrimiriyala/ragimage works
This is a Streamlit image-text extraction workspace with a terminal-based RAG question-answering workflow. Users upload an image, tune preprocessing, extract and inspect OCR text, then can ask questions from the terminal; answers are grounded in retrieved image text. The guide page demonstrates preprocessing options. The main pipeline is excerpted; its documented stages are represented separately even when implemented in one file. External OCR, embedding, vector-store, and LLM dependencies are shown only where the source or README supports the relationship.
Main entry points: app.py Image workspace · rag_pipeline.py Text cleanup and chunks · 1_OpenCV_Guide.py OpenCV guide
Components 18
User interfaces
- Image workspace
app.py - OpenCV guide
pages/1_OpenCV_Guide.py - Terminal interface
rag_pipeline.py - OCR results
app.py
Image ingestion
- Live preview
app.py - Image preprocessing
rag_pipeline.py - Text recognition
rag_pipeline.py - Text cleanup and chunks
rag_pipeline.py
Question answering
- Text embeddings
rag_pipeline.py - Image vector store
rag_pipeline.py - Relevant chunk retrieval
rag_pipeline.py - Grounded answer prompt
rag_pipeline.py - Answer generation
rag_pipeline.py
External integrations
- Tesseract OCR
- Hugging Face model
- ChromaDB
- Groq LLM
Other components
- User
Connections 24
- User → Image workspace: uploads image
app.py - Image workspace → Live preview: requests preview
app.py - Live preview → Image preprocessing: calls
app.py - User → Image workspace: sets options
app.py - Image workspace → Image preprocessing: calls on extract
rag_pipeline.py - Image preprocessing → Text recognition: passes processed image
rag_pipeline.py - Text recognition → Tesseract OCR: recognizes text
rag_pipeline.py - Text recognition → Text cleanup and chunks: returns OCR text
rag_pipeline.py - Text cleanup and chunks → Text embeddings: creates chunk documents
rag_pipeline.py - Text embeddings → Hugging Face model: embeds chunks
rag_pipeline.py - Text cleanup and chunks → Image vector store: adds documents
rag_pipeline.py - Image vector store → ChromaDB: persists vectors
rag_pipeline.py - Image workspace → OCR results: shows extracted text
app.py - Text cleanup and chunks → OCR results: provides text and count
app.py - User → OpenCV guide: opens guide
pages/1_OpenCV_Guide.py - OpenCV guide → Image preprocessing: demonstrates settings
pages/1_OpenCV_Guide.py - User → Terminal interface: starts image query
rag_pipeline.py - Terminal interface → Text cleanup and chunks: ingests image
rag_pipeline.py - Terminal interface → Relevant chunk retrieval: submits question
rag_pipeline.py - Relevant chunk retrieval → Image vector store: searches top chunks
rag_pipeline.py - Relevant chunk retrieval → Grounded answer prompt: supplies context
rag_pipeline.py - Grounded answer prompt → Answer generation: formats question and context
rag_pipeline.py - Answer generation → Groq LLM: generates answer
rag_pipeline.py - Answer generation → Terminal interface: returns answer
rag_pipeline.py