An AI-powered application that finds similar images using deep learning techniques.
This project implements an image similarity search using a pre-trained Vision Transformer (ViT) model. It allows users to upload an image and find visually similar images from a pre-defined dataset.
- Utilizes a Vision Transformer (ViT) model for feature extraction
- Pre-extracted features for quick similarity comparisons
- Flask web application for easy interaction
- Supports various image formats (PNG, JPG, JPEG, GIF)
-
Clone the repository
git clone https://github.com/beavishead/similar_images_search.git cd similar_images_search
-
Set up a virtual environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
-
Access the application
- Open a web browser and go to
http://localhost:5000
- Open a web browser and go to
app.py
: Main Flask applicationmodel.py
: Contains the model loading and feature extraction logicfeature_extractor.py
: Script for pre-extracting features from the datasetmodel_weights.pth
: Pre-trained model weightspre_extracted_features.npz
: Pre-computed features for the dataset
-
Deploy the app on web. The issues I faced are the dataset of images are being compared to is too large for the free tiers og deployment platforms.
-
Make more meaningful app. The current app was made primarily as a blueprint of how a ml-model maybe implemented in a web application.
-
More meaningful tasks would be: -- scraping images from the web -- detecting the potentially explicit content -- adding the ability to label images with a certain textual category
-
make the uploaded by users images disappear after some time