๐Ÿ“š Bookshelf AI Link to heading

Bookshelf AI 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

  1. OCR โ€” PaddleOCR scans the image and extracts raw text from book spines
  2. Title Cleaning โ€” Noise, fragments, and split lines are filtered and merged
  3. Validation โ€” Each candidate title is matched against Open Library to get the canonical title
  4. 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.