基于MatConvNet的CNN图像搜索引擎PicSearch

简介

Picsearch是一种基于卷积神经网络特征的图像搜索引擎。

Github:https://github.com/willard-yuan/CNN-for-Image-Retrieval

Web Demo:http://yongyuan.name/pic/

数据集

Caltech256图像数据集:包含29780张图像与256个类。

源码结构

The code is written by Python, and the web server is cherrypy.

├── 256feat2048Norml.mat //The features extract by CNN on Caltech256.
├── bootstrap
├── favicon.ico
├── searchEnginePython.py
├── service-server.conf
├── service.conf
├── style.css
└── thumbnails //The thumbnails of Caltech256.It can be replaced by the original image dataset.

 注意:在其他数据集上进行测试时,必须先提取其特征。比如用CNN-for-Image-Retrieval提取其他数据集的特征。

运行

1.编辑service.conf

Changes the path of tools.staticdir.root to your path.

[global]
server.socket_host = "127.0.0.1"
server.socket_port = 8080
server.thread_pool = 10
tools.sessions.on = True

[/]
tools.staticdir.root = "/home/ysp/PicSearch"

[/]
tools.staticdir.on = True
tools.staticdir.dir = ''

2.运行服务器

Python searchenginepython.py

此时,CherryPy自带的Web服务已经启动,提示信息已经指出了,默认的端口是8080。

问题:import cherrypy ImportError:No module named cherrypy

解决:

(1)从GitHub上获取最新版CherryPy源代码

git clone https://github.com/cherrypy/cherrypy

或在https://pypi.python.org/pypi/CherryPy上,下载最新版CherryPy源代码

(2)解压源代码,输入命令安装

$ cd cherrypy
$ python setup.py install

 (3)修改searchenginepython.py

import sys
cherrypy_root='/opt/cherrypy/'
sys.path.insert(0,cherrypy_root)
import cherrypy

3.打开浏览器,访问网站:127.0.0.1:8080

原文地址:https://www.cnblogs.com/YSPXIZHEN/p/6431734.html