Typing-free Image and Tag Augmented Navigation
We use Miniconda to handle the compatibility between the python packages and make the virtual pyhton env.
conda install django==1.11.10
conda install -c conda-forge djangorestframework
conda install keras
conda install numpy
conda install opencv
conda install scikit-image
conda install elasticsearch==5.4
conda install elasticsearch-dsl==5.3
conda install keras-gpu
import keras
keras.backend.tensorflow_backend._get_available_gpus()
There are 2 services need to start:
# Image search
sudo su -l titan
cd TITAN/image_search/fileupload/
nohup python manage.py runserver 0.0.0.0:8000 &
# tag navigation
sudo su -l elk
cd elk/elasticsearch/
./bin/elasticsearch -d
http://venraas.github.io/demo/recomd_mobile_20190408_package/recomd_tags_cam.html
http://${ServerIP}:8000/cupid/upload/
http://${ServerIP}:9200
In this step, we generate the images dense vectors, flat_imgfea.py, and concatenate them, compact_feature_dir.py, into multiple compact bulks with numpy format.
We will apply this dense vector model to calculate the similarity with the input image and seek the nearest topK for result.
Generates the model dense vectors for all input images.
Ex. python flat_imgfea.py n04204238-shopping_basket vgg16_dense
usage: flat_imgfea.py [-h] dirImgs dirFeaVcts
positional arguments:
dirImgs the directory of the source images
dirFeaVcts the directory for the output feature vectors of the given images
optional arguments:
-h, --help show this help message and exit
Concatenates a bunch of the image feature vectors into a compact bulk vector.
Ex. python compact_feature_dir.py vgg16_dense
usage: compact_feature_dir.py [-h] dir
positional arguments:
dir the root dir of all image features
optional arguments:
-h, --help show this help message and exit