1時間で画像検索エンジンを作る [英語版]

松井勇佑


Overview

  • このページは「1時間で画像検索エンジンを作る」というハンズオンセミナーの資料になります.
  • シンプルな画像検索エンジンであるsisを導入します.デモはこちらです.
  • SisはFlaskおよびKerasを用いて作られています.事前学習済みのVGG16モデルを用いて,各画像から4096次元のfc6特徴量を抽出し,検索を行います.
  • Sisはわずか62 行 (python) + 24 行 (html)で記述されます.

Links

How to run (on your local computer)

# Make sure numpy, Pillow, h5py, tensorflow, Keras, and Flask are installed
# Clone the code
$ git clone https://github.com/matsui528/sis.git
$ cd sis

# Put your image files (*.jpg) on static/img

$ python offline.py    # python3
# Then fc6 features are extracted and saved on static/feature

$ python server.py
# Now you can do search via localhost:5000

How to run (on AWS EC2)

# Launch an instance on AWS EC2, and open the port 5000.
# A middle-level CPU instance is fine, e.g., m4.large.
# Make sure you can ssh. Then log in the instance.

# Setup python stuff
$ wget https://repo.continuum.io/archive/Anaconda3-4.3.0-Linux-x86_64.sh
$ bash Anaconda3-4.3.0-Linux-x86_64.sh
$ source ~/.bashrc  # Activate anaconda
$ pip install tensorflow keras

# Clone the code
$ git clone https://github.com/matsui528/sis.git
$ cd sis

# Put your image files (*.jpg) on static/img

$ python offline.py
# Then fc6 features are extracted and saved on static/feature

$ python server.py
# Now you can do search via http://ec2-XX-XX-XXX-XXX.us-west-2.compute.amazonaws.com:5000