https://github.com/flexoid/image-ocr-search
Image Search CLI application with OCR
https://github.com/flexoid/image-ocr-search
Last synced: about 1 year ago
JSON representation
Image Search CLI application with OCR
- Host: GitHub
- URL: https://github.com/flexoid/image-ocr-search
- Owner: flexoid
- License: mit
- Created: 2024-05-19T14:54:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T14:55:55.000Z (about 2 years ago)
- Last Synced: 2024-10-12T07:43:33.164Z (over 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image Search CLI application with OCR
This CLI application provides an image-search functionality using Optical Character Recognition (OCR). It's written in Python 3, uses the `EasyOCR` library for image scanning, and a PostgreSQL database for storing scan results. You can index an image directory recursively and perform full-text search over the available scan results.
Personally, I find it very useful for searching all my screenshots stored in the Desktop directory.
## Installation
1. Clone the repository.
2. Change into the directory.
3. Install virtualenv:
`pip3 install virtualenv`
4. Create a virtual environment:
`virtualenv venv`
5. Activate the virtual environment:
On Windows, use: `venv\Scripts\Activate`
On macOS and Linux, use: `source venv/bin/activate`
6. Install the required dependencies:
`pip3 install -r requirements.txt`
7. Create a `.env` file using the provided example and update the parameters, such as the database connection details and OCR languages:
```
cp .env.example .env
```
## Basic Usage
- To index or scan a directory recursively, use:
`python3 main.py load_and_index directory_path --since "interval"`
The `--since` parameter is optional. It selects files modified within a certain interval in a human-readable format, like "2 months ago", "3 weeks", "1 year", etc.
- To perform a full-text search over the available scan results, use:
`python3 main.py search your_query`
It outputs the list of files that contain the requested text.
## License
This project is licensed under the MIT License.