For QnA/Help Use : https://gemini.google.com/share/19600477641d
A fully offline, CPU-only multimodal forensic search engine. Point it at a folder of images, PDFs, or documents β then search by text or by uploading an image. Everything stays on your machine. No cloud, no GPU, no internet required.
| Search Type | How It Works | Example |
|---|---|---|
| Text β Text | Type a query, find documents with matching meaning (not just keywords). | Search "invoice fraud" β finds documents about billing scams, even if they don't contain those exact words |
| Text β Image | Type a description, find visually matching images. | Search "sunset over mountains" β finds landscape photos |
| Image β Image | Upload an image, find visually similar images. | Upload a photo β find duplicates or near-matches |
| PDF Search | Scanned or digital PDFs are auto-extracted (OCR + text). | Search inside scanned government documents |
Your Files β Ingest β Extract Text (OCR/PDF) β Generate Embeddings β Build Vector Index
β
Search Query β Embed Query β Find Nearest Vectors β Results
- Embeddings = turning text/images into numerical vectors that capture meaning
- Vector search = finding the closest vectors (most similar content) using FAISS or brute-force
- OCR = extracting text from images/scanned PDFs using Tesseract
You need Tesseract OCR and Poppler (for PDF rendering) installed on your system.
π§ Linux / WSL (Ubuntu/Debian)
sudo apt update
sudo apt install tesseract-ocr poppler-utilsπͺ Windows (Native)
Using Chocolatey (recommended):
choco install tesseract popplerManual:
- Tesseract: Download from UB-Mannheim/tesseract
- Poppler: Download from poppler-windows
β οΈ Add both to your system PATH after manual installation.
π macOS
brew install tesseract popplergit clone https://github.com/rachit9876/finalYear.git
cd finalYearπ§ Linux / WSL / π macOS
python3 -m venv .venv
source .venv/bin/activateπͺ Windows (PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1If you get an execution policy error:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
pip install -e ".[web,embeddings,faiss,ocr,pdf_images]"β±οΈ This downloads the CLIP model (~350 MB) on first run. After that, everything is offline.
fysearch init
fysearch webOpen http://127.0.0.1:5000 in your browser. That's it! π
In the sidebar, paste the full path to a folder containing your files:
| Platform | Example Path |
|---|---|
| Linux / WSL | /mnt/c/Users/YourName/Pictures/test |
| Windows | C:\Users\YourName\Pictures\test |
| macOS | /Users/YourName/Pictures/test |
β WSL users: You can paste either Windows paths (
C:\Users\...) or WSL paths (/mnt/c/Users/...) β both are auto-converted.
Check "Run full pipeline" and click Apply. This will:
- Ingest β Copy files to the local store
- Extract β Run OCR on images, extract text from PDFs
- Build Indexes β Create searchable vector indexes
β±οΈ Timing: ~1-2 sec/file for ingestion, ~4 sec/image for embedding, ~2 sec/document for text embedding.
| Tab | What to Do |
|---|---|
| Text Search | Type any query β click Search. Uses Auto (Smart) mode by default β searches both text and images. |
| Image Search | Drag & drop an image, paste from clipboard, or click to browse β click Search. |
- Search Mode:
Auto(both),Text β Text, orText β Image - Results: Number of results to return (1β50)
If you add new files later, you can rebuild indexes from the sidebar without re-ingesting:
- Build Image Index β Re-embed all images
- Build Text Index β Re-embed all extracted text
All features are also available from the command line:
# Initialize project
fysearch init
# Show/edit config
fysearch config
fysearch config --text-model "sentence-transformers/clip-ViT-B-32"
fysearch config --ocr-languages "eng+hin"
# Ingest files
fysearch ingest /path/to/your/files
# Extract text (OCR + PDF parsing)
fysearch extract
# Build search indexes
fysearch build-index --modality text
fysearch build-index --modality image
# Search
fysearch search-text "your query" --top-k 10
fysearch search-text "your query" --modality image # text β image search
fysearch search-image /path/to/query.jpg --top-k 5 # image β image search
# Launch web UI
fysearch web # http://127.0.0.1:5000
fysearch web --port 8000 # custom port
fysearch web --host 127.0.0.1 # localhost onlySettings are stored in fysearch.config.json at the project root:
| Key | Default | Description |
|---|---|---|
text_model |
sentence-transformers/clip-ViT-B-32 |
Model for text embeddings |
image_model |
sentence-transformers/clip-ViT-B-32 |
Model for image embeddings |
dataset_path |
"" |
Path to your dataset folder |
ocr_languages |
eng |
Tesseract languages (e.g., eng, hin, eng+hin) |
embedding_dim |
512 |
Vector dimension (must match model output) |
max_workers |
0 |
Parallel workers (0 = auto-detect from CPU cores) |
WSL is the recommended way to run FYSearch on Windows. Here's the full setup:
# 1. Install system deps inside WSL
sudo apt update && sudo apt install tesseract-ocr poppler-utils python3-venv
# 2. Navigate to the project (your Windows files are under /mnt/c/)
cd /mnt/c/Users/YourName/Documents/GitHub/finalYear
# 3. Create venv & install
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[web,embeddings,faiss,ocr,pdf_images]"
# 4. Initialize and run
fysearch init
fysearch webThen open http://127.0.0.1:5000 in your Windows browser (Edge, Chrome, etc.).
π‘ Tip: The web server binds to
0.0.0.0by default, so it's automatically accessible from your Windows browser.
π‘ Tip: You can paste Windows-style paths (
C:\Users\...) in the web UI β they're auto-converted to WSL format.
finalYear/
βββ src/fysearch/ # Source code
β βββ cli.py # Command-line interface (Typer)
β βββ config.py # Configuration management
β βββ db.py # SQLite database layer
β βββ embeddings.py # CLIP text/image embedders
β βββ extract.py # OCR + PDF text extraction
β βββ ingest.py # File ingestion pipeline
β βββ paths.py # Path resolution + WSL support
β βββ vector_index.py # FAISS / brute-force vector search
β βββ webapp.py # Flask web application
β βββ templates/
β βββ index.html # Web UI template
βββ data/ # Runtime data (auto-created)
β βββ input/ # Original input files
β βββ store/ # Content-addressed file store
β βββ db/ # SQLite database
β βββ index/ # Vector indexes (.npz)
βββ fysearch.config.json # Configuration file
βββ pyproject.toml # Python package definition
| Type | Extensions | Processing |
|---|---|---|
| Images | .jpg, .jpeg, .png, .webp, .bmp, .tif, .tiff |
OCR (optional) + image embedding |
| PDFs | .pdf |
Text extraction + per-page image rendering + OCR for scanned pages |
| Text | .txt |
Direct text reading |
| Issue | Solution |
|---|---|
tesseract not found |
Install Tesseract and ensure it's in your PATH |
poppler not found |
Install Poppler and ensure it's in your PATH |
No module named 'sentence_transformers' |
Run pip install -e ".[embeddings]" |
No module named 'flask' |
Run pip install -e ".[web]" |
| Virtual env won't activate (Windows) | Run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser |
| Port already in use | Use fysearch web --port 8080 |
| WSL: folder not found | Use /mnt/c/Users/... format for Windows paths |
| Slow first run | Normal β the CLIP model (~350 MB) downloads on first use |
| Out of memory | Reduce image count or close other apps (needs ~4-8 GB RAM for embedding) |
| Component | Technology |
|---|---|
| Embeddings | CLIP ViT-B/32 via sentence-transformers |
| Vector Search | FAISS (CPU) with brute-force fallback |
| OCR | Tesseract via pytesseract |
| PDF Rendering | Poppler via pdf2image |
| Web UI | Flask |
| CLI | Typer + Rich |
| Database | SQLite (WAL mode for concurrency) |
MIT β see LICENSE.