A modern AI-powered visual search engine that understands images and retrieves visually similar results in real time. Built using TensorFlow, FastAPI, and Next.js, this project blends deep learning, high-performance backend architecture, and a smooth, responsive, animation-rich frontend experience.
This system performs content-based image retrieval (CBIR) by converting images into feature embeddings and matching them against a precomputed index. The project demonstrates full-stack engineering across:
- Deep learning inference
- Image feature extraction
- Vector similarity search
- High-performance API development
- Modern frontend design with professional UI/UX
It captures the workflow of a real-world AI product from backend intelligence to polished user interface.
The uploaded image is resized, normalized, and converted into a tensor suitable for inference.
A trained CNN encodes the image into a high-dimensional embedding representing its visual characteristics.
Two precomputed files are used for retrieval:
PPL_Images_features.pkl— stored feature vectorsPPLfilenames.pkl— image file locations
The backend uses K-Nearest Neighbors to find the closest matches.
The API:
- Accepts an uploaded image
- Extracts its embedding
- Searches the dataset
- Returns a JSON response with similar images
It is optimized for ML workloads using FastAPI’s asynchronous architecture.
The UI is built with:
- Next.js App Router
- Tailwind CSS
- Framer Motion animations
Features include drag-and-drop uploading, responsive design, smooth transitions, and animated result rendering.
- TensorFlow
- Convolutional Neural Networks
- Feature Embeddings
- KNN Similarity Search
- FastAPI
- Python
- Uvicorn
- Pydantic
- Next.js 16
- React
- Tailwind CSS
- Framer Motion
- OpenCV
- NumPy
- Scikit-learn
- Pickle for feature storage
.
├── backend/
│ ├── main.py
│ ├── extract.py
│ ├── utils/
│ └── models/
│ ├── PPL_Images_features.pkl
│ ├── PPLfilenames.pkl
│
|
├── frontend/
│ ├── app/
│ ├── components/
│ ├── public/
│ └── styles/
|
└── README.md
git clone https://github.com/sandulr/visual-search-ai.git
cd visual-search-aicd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtuvicorn main:app --reloadBackend runs at:
http://localhost:8000
cd ../frontend
npm installnpm run devFrontend runs at:
http://localhost:3000
- Deep learning–based visual search
- Real-time similarity matching
- Fully responsive interface
- Drag-and-drop image upload
- Modern animated UI using Framer Motion
- Smooth transitions and professional UX
- High-performance FastAPI backend
- Clean separation of frontend and backend layers
- Upload an image via drag-and-drop
- Backend extracts features using TensorFlow
- KNN retrieves similar images
- Results appear in an animated grid
- GPU-accelerated inference
- Vector database integration (FAISS / Pinecone)
- Multi-image search
- User-specific collections
- Incremental image indexing
- Optional captions or multimodal search
MIT License
Thanks to the open-source community powering tools like TensorFlow, FastAPI, and Next.js.