The Document-Image Matching System is an advanced application designed to analyze images, extract keywords, and fetch relevant books using cutting-edge AI capabilities. It leverages OpenAI's vision and text APIs, alongside the Open Library API, to deliver accurate and efficient results.
-
AI-Powered Image Analysis
- Utilizes an OpenAI vision model to generate textual descriptions from images.
- Summarizes descriptions into concise keywords.
-
Open Library Integration
- Searches the Open Library database using extracted keywords.
- Retrieves book details, including titles, authors, and publication years.
-
Async Processing Pipeline
- Efficiently handles asynchronous operations for image analysis and book search.
- Converts images to base64 for seamless API interaction.
-
User-Friendly Interface
- Developed with Gradio for an interactive, easy-to-use platform.
- Allows users to upload images and view results directly in the application.
-
Image Upload:
- Users upload an image through the interface.
-
Image Processing:
- The system converts the image to base64 format.
- The encoded image is analyzed by OpenAI's vision API for descriptive text.
-
Keyword Extraction:
- The descriptive text is summarized into concise keywords.
-
Book Retrieval:
- Extracted keywords are used to query the Open Library API.
- Relevant book details are fetched and displayed in a tabular format.
-
Result Presentation:
- Keywords and corresponding books are shown in the application for user review.
- Python 3.8+
- Required libraries:
os
base64
requests
pandas
gradio
asyncio
dotenv
openai
-
API Key Setup:
- Create a
.env
file in the project directory. - Add your OpenAI API key:
OPENAI_API_KEY=your_secret_api_key_here
- Create a
-
Dependencies Installation:
- Install required libraries using pip:
pip install -r requirements.txt
- Install required libraries using pip:
-
Launching the Application:
- Run the script using Python:
python app.py
- Run the script using Python:
-
Uploading an Image:
- Use the Gradio interface to upload an image.
-
Viewing Results:
- Keywords and relevant books are displayed after processing.
Copyright (c) 2024 Partha Pratim Ray
Permission is hereby granted, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use the Software for personal or academic purposes only, subject to the following conditions:
-
Commercial Use: This Software is licensed for commercial use only under explicit written permission and a fee agreed upon with the author, Partha Pratim Ray. Unauthorized commercial use, including but not limited to distribution, sublicensing, or monetization of this Software or any derivative works, is strictly prohibited and subject to legal action.
-
Restrictions:
- The Software shall not be used for any unlawful or unethical purpose.
- Duplication, replication, or redistribution of the Software, in whole or in part, is prohibited without prior written consent.
- Modification or removal of any copyright notices is prohibited.
-
Attribution:
- All usage, publications, or projects utilizing this Software must give appropriate credit to the author, Partha Pratim Ray.
- Include the following attribution statement in any derivative works or research:
"This software was developed by Partha Pratim Ray and is used under a commercial license."
-
Warranty Disclaimer: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For licensing inquiries, fees, or permissions, contact:
- Email: parthapratimray1986@gmail.com
- GitHub: ParthaPRay