skane1024 / flask-keras-cnn-image-retrieval

🚀CNN-based image retrieval built on Keras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image Retrieval Engine Based on Keras

License

演示

,web界面采用的SoTu

环境

In [1]: import keras
Using Theano backend.

keras 2.0.1 及 2.0.5 版本均经过测试可用。推荐Python 2.7,支持Python 3.6.

此外需要numpy, matplotlib, os, h5py, argparse. 推荐使用anaconda安装

使用

  • 步骤一

python index.py -database <path-to-dataset> -index <name-for-output-index>

  • 步骤二

python query_online.py -query <path-to-query-image> -index <path-to-index-flie> -result <path-to-images-for-retrieval>

├── database 图像数据集
├── extract_cnn_vgg16_keras.py 使用预训练vgg16模型提取图像特征
|── index.py 对图像集提取特征,建立索引
├── query_online.py 库内搜索
└── README.md

示例

# 对database文件夹内图片进行特征提取,建立索引文件featureCNN.h5
python index.py -database database -index featureCNN.h5

# 使用database文件夹内001_accordion_image_0001.jpg作为测试图片,在database内以featureCNN.h5进行近似图片查找,并显示最近似的3张图片
python query_online.py -query database/001_accordion_image_0001.jpg -index featureCNN.h5 -result database

更新

  • 重新用flask写web界面,已完成。

论文推荐

awesome-cbir-papers

问题汇总

  • query_online.py line 28报错,将index.py line 62注释,使用line 61.

About

🚀CNN-based image retrieval built on Keras


Languages

Language:Python 100.0%