๐ Bookshelf AI Link to heading
An intelligent book discovery tool that reads your bookshelf from a photo and recommends new books to read.
Point it at a photo of your bookshelf โ it extracts the titles using OCR, validates them against Open Library, and generates personalised recommendations based on your collection. Everything runs locally with no API keys required.
โจ Features Link to heading
- ๐ธ OCR extraction โ PaddleOCR scans the photo and lifts raw text from every visible book spine
- ๐ Title cleaning โ Noise, fragments, and split lines are filtered and merged into clean candidate titles
- ๐๏ธ Open Library match โ Each title is validated against Open Library to get the canonical version and metadata
- ๐ Language detection โ Automatically detects the language of your collection for relevant suggestions
- ๐ค Smart recommendations โ Subjects, genres, and themes from your matched books surface new titles you’ll likely enjoy
- ๐ No API keys or external accounts needed
๐ Pipeline Link to heading
Photo โ OCR โ Clean โ Validate (Open Library) โ Recommend
01 02 03 04 05
๐ Project Structure Link to heading
main.py Entry point โ runs the full pipeline
ocr.py OCR engine wrapper (PaddleOCR)
matcher.py Title cleaning and Open Library matching
recommender.py Book recommendation engine
requirements.txt Python dependencies
bookshelf.jpg Sample bookshelf image for testing
๐งฐ Requirements Link to heading
- Python 3.9 or higher
- Internet connection (for Open Library API queries)
- PaddleOCR models are downloaded automatically on first run
๐ฆ Installation Link to heading
Clone the repository:
git clone https://github.com/rustamdurdyyev/Bookshelf-AI
cd Bookshelf-AI
(Optional) Create a virtual environment:
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Note: PaddleOCR will download its models on the first run. This may take a minute.
๐ Usage Link to heading
Run the pipeline on the default sample image:
python main.py
To use your own bookshelf photo, edit the image_path variable at the top of main.py:
image_path = "your_bookshelf.jpg"
๐ง How It Works Link to heading
- OCR โ PaddleOCR scans the image and extracts raw text from book spines
- Title Cleaning โ Noise, fragments, and split lines are filtered and merged
- Validation โ Each candidate title is matched against Open Library to get the canonical title
- Recommendations โ Subjects and genres from your matched books are used to find new titles you might enjoy
๐ Supported Image Formats Link to heading
.jpg, .jpeg, .png, .webp
Works best with clear, well-lit photos where book spines are visible and upright.
๐ License Link to heading
This project is open-source. Feel free to use, modify, and share.