はじめに
DELF: DEep Local Features という技術がある。
挙動をみるために、動かしてみようとしたが、公開されているコードで、素直に動作するものがなくて、しばらく、探した。
(中身がよくわかっていれば、素直に動かなくてもなんとかできると思うが、、、)
以下のコードは、素直に動くのでご紹介。
(情報が不足していれば、コメント等下さい。)
この記事の成果の、ほぼ、すべて。以下のアドレスです。
↓
https://github.com/tensorflow/hub/blob/master/examples/colab/tf_hub_delf_module.ipynb
※ ipynb(よく知りませんが、jupyter notebook用だと思いますが、中身のpythonのコードをそのまま実行させました。問題なし、でした。)
関連論文:
https://arxiv.org/abs/1612.06321
Large-Scale Image Retrieval with Attentive Deep Local Features
Hyeonwoo Noh, Andre Araujo, Jack Sim, Tobias Weyand, Bohyung Han
(Submitted on 19 Dec 2016 (v1), last revised 3 Feb 2018 (this version, v4))
https://arxiv.org/abs/1812.01584
Detect-to-Retrieve: Efficient Regional Aggregation for Image Search
Marvin Teichmann, Andre Araujo, Menglong Zhu, Jack Sim
(Submitted on 4 Dec 2018 (v1), last revised 14 May 2019 (this version, v2))
関連Github
https://github.com/tensorflow/models/tree/master/research/delf
DELF: DEep Local Features
This project presents code for extracting DELF features, which were introduced with the paper "Large-Scale Image Retrieval with Attentive Deep Local Features". It also contains code for the follow-up paper "Detect-to-Retrieve: Efficient Regional Aggregation for Image Search".
We also released pre-trained models based on the Google Landmarks dataset.
DELF is particularly useful for large-scale instance-level image recognition. It detects and describes semantic local features which can be geometrically verified between images showing the same object instance. The pre-trained models released here have been optimized for landmark recognition, so expect it to work well in this area. We also provide tensorflow code for building the DELF model, which could then be used to train models for other types of objects.
Google翻訳(以下、ママ)
DELF:DEepローカル機能
このプロジェクトでは、「注意深いディープローカル機能を使用した大規模画像検索」という論文で紹介されたDELF機能を抽出するためのコードを紹介します。 また、フォローアップペーパー「Detect-to-Retrieve:Efficient Regional Aggregation for Image Search」のコードも含まれています。
また、Googleランドマークデータセットに基づいて事前にトレーニングされたモデルをリリースしました。
DELFは、大規模なインスタンスレベルの画像認識に特に役立ちます。 同じオブジェクトインスタンスを示す画像間で幾何学的に検証できるセマンティックローカルフィーチャを検出して記述します。 ここでリリースされた事前トレーニング済みモデルは、ランドマーク認識用に最適化されているため、この分野でうまく機能することを期待してください。 また、他のタイプのオブジェクトのモデルをトレーニングするために使用できるDELFモデルを構築するためのテンソルフローコードも提供します。
結果
以下、動作結果。
中身自体には、言及しませんが、それなりにすばらしい気がします。
ちなみに、
↓ tensorflow hubの形式です。この形で実施したかったわけではないが、これしか動作
しませんでした。
m = hub.Module('https://tfhub.dev/google/delf/1')
以下は、適当に著作権フリーの画像で試した結果。
絶賛できるほどではないが、よく動作していると思う。
動作環境
windows10
Python 3.7.2
tensorflow 1.14.0
動かすために必要な作業
jupyter notebookの使い方を知らないので、
それは使わずに、pythonのコードを実行させた。
以下の1行のみ追加した。(jupyter notebookの場合は、不要なんじゃないでしょうか?)
ax.axis('off')
ax.set_title('DELF correspondences')
plt.show() #この行のみ追加。動いている感じがあったのに、最後の表示がされなかったため。
まとめ
動きました。
今後
技術的な内容など、別途、フォローしたいと考えています。
コメントなどあれば、宜しくお願いします。