/cbir-web

Primary LanguagePython

cbir-web

Integrated CBIR web application, depend on Swin-Transformer for feature extraction and Faiss for similarity search. A deep learning based classification framework MMClassification is used to simplify the model migration process.
The web service architecture is Flask + VueJS.

Requirements

  • Backend
    • torch 1.7+
    • mmcv-full
    • mmclassification
    • flask
  • Frontend
    • npm
    • axios
    • vuetify

Installation

git clone --recurse-submodules https://github.com/AnxQ/cbir-web

# For CPU
conda install pytorch torchvision -c pytorch
# For CUDA 11.3
conda install pytorch==1.10.0 torchvision==0.11.1 cudatoolkit=11.3 -c pytorch

pip install -r requirements.txt
pip install git+https://github.com/open-mmlab/mim.git
mim install mmcls

cd ../cbir-front
npm install

Model preparation and database generation

  1. Download the pth for swin-tiny and put it in checkpoints
  2. Symbol link or modify the configs in gen_vectors.py
  3. Run python gen_vectors.py

Startup

  • Backend
FLASK_APP = main.py
FLASK_ENV = development
FLASK_DEBUG = 1
python -m flask run
  • Frontend
cd cbir-front
npm run serve

The application will be run at http://localhost:8082/