How stonesteel27/comiq works
Main Components
• Core Library (comiq package): The central part of the system with files like comiq.py, ai_processing.py, ocr.py, preprocessing.py, prompts.py, and utils.py.
• External OCR Engines: Represent the two external OCR engines (EasyOCR and PaddleOCR) that the library interacts with.
• Google's Gemini Flash Model: Denote this as an external AI service used to enhance or process OCR results.
• API Key Management: A component responsible for managing and validating API keys (via set_api_key) for accessing Gemini features.
• Client Interface: The user-facing Python module call, where developers import ComiQ and call high-level functions like extract().
Out the Data Flow and Relationships
• EasyOCR Module (external service/engine)
• PaddleOCR Module (external service/engine)
• From these OCR modules, combine the results via an “Aggregation/Merging Component” (often orchestrated by logic in ocr.py or even comiq.py).
• Next, indicate a connection from the aggregated OCR results to the “AI Processing Component” (ai_processing.py) which represents the integration with the Gemini Flash 1.5 model. Also, note the role of prompts (handled by prompts.py) that may assist in querying or processing the OCR outputs.
Important Architectural Patterns
• Modular Design: Each file in the comiq package represents a distinct functional module. Highlight how these modules interact through well-defined functions and layers.
• Abstraction of External Services: Separate blocks for each OCR engine and external AI model, indicating that they are “pluggable” parts of the architecture.
Relevant Technologies and Design Principles
• Python-based library with file modules for utility functions and orchestration.
• Leveraging external libraries and models (EasyOCR, PaddleOCR, OpenCV – for image handling, and the Gemini Flash API).