This project implements a visual similarity search engine using Weaviate vector database and neural network-based image embeddings. It allows you to upload images and find visually similar ones using AI.
- Docker and Docker Compose
- Node.js v16 or higher
- npm
- Clone the repository:
git clone https://github.com/TennysonGeorge/search-image-service.git
cd search-image-service- Install dependencies:
npm install- Start the Weaviate services:
docker-compose up -dThis will start:
- Weaviate vector database
- ResNet50 image inference API
- Start the application:
npm start- Open your browser and navigate to:
http://localhost:3000
- Drag and drop interface for image uploads
- Visual results display
- Similarity scoring
| Endpoint | Method | Description |
|---|---|---|
/api/status |
GET | Check API status |
/api/images |
GET | List all indexed images |
/api/upload |
POST | Upload a single image |
/api/upload/bulk |
POST | Batch upload from img directory |
/api/search |
POST | Find similar images |
curl -X POST -F "image=@/path/to/your/image.jpg" http://localhost:3000/api/uploadcurl -X POST -F "image=@/path/to/your/query.jpg" http://localhost:3000/api/searchcurl -X POST http://localhost:3000/api/upload/bulkserver.js: Express API serverutils.js: Shared utility functionsupload.js: Image upload functionalitysearch.js: Image search functionalitypublic/: Web interface filesdocker-compose.yml: Defines required servicesimg/: Directory for source images to be indexeduploads/: Temporary directory for uploaded filesresults/: Directory for search result images
- Image Vectorization: Uses ResNet50 neural network to convert images into high-dimensional vectors
- Vector Storage: Weaviate stores these vectors in an efficient searchable format
- Similarity Search: When searching, new images are converted to vectors and compared to find the most similar matches
- If you get connection errors, ensure Docker containers are running:
docker-compose ps- To reset the database, stop and remove containers:
docker-compose down -v- Weaviate: Vector database
- Express.js: Web framework
- ResNet50: Neural network for image feature extraction
- Node.js: Runtime environment
- Docker: Containerization
ISC