SlideShare a Scribd company logo
image-match
osakapy 2016.04
15 April 2016
Hideo Hattori
Software Enginner, KLab Inc. (Osaka)
whoami
Hideo Hattori (github(https://github.com/hhatto))
Python / Go / C / Rust / Zsh
My Python Projects autopep8(https://github.com/hhatto/autopep8), pgmagick(https://github.com/hhatto/pgmagick/),
poyonga(https://github.com/hhatto/poyonga), genzshcomp(https://bitbucket.org/hhatto/genzshcomp)...
image-match
image-match
image-match
image-match(https://github.com/ascribe/image-match)
Python2.x only
libpuzzle(https://www.pureftpd.org/project/libpuzzle)
Perceptual Hash
image-match
image-match
$ brew install py2cairo cairo elasticsearch
$ pip install numpy scipy image_match
2
from image_match.goldberg import ImageSignature
gis = ImageSignature()
a = gis.generate_signature('a.jpg')
b = gis.generate_signature('b.jpg')
c = gis.generate_signature('c.jpg')
print("a-b: %f" % gis.normalized_distance(a, b))
print("a-c: %f" % gis.normalized_distance(a, c))
$ python distance.py
a-b: 0.220952
a-c: 0.684463
=
with Elasticsearch
Elasticsearch(https://www.elastic.co/products/elasticsearch)
from elasticsearch import Elasticsearch
from image_match.elasticsearch_driver import SignatureES
es = Elasticsearch()
ses = SignatureES(es)
es = Elasticsearch()
ses = SignatureES(es, size=10, distance_cutoff=0.9)
ses.add_image(filename)
ses.search_image(filename)
{'path': u'image/image_08179.jpg', 'score': 56.06757, 'dist': 0.0, 'id': u'AVQQyhUEJXUmYMIAjxKA'}
{'path': u'image/image_01623.jpg', 'score': 0.2764881, 'dist': 0.55480701966252521, 'id': u'AVQQxa3_JX
{'path': u'image/image_04659.jpg', 'score': 0.33701482, 'dist': 0.56801020853288964, 'id': u'AVQQx7GOJ
otama image-match
otama(https://github.com/nagadomi/otama)
otamapy(https://github.com/hhatto/otamapy)otama Python
http:// owers.libotama.so/
(8189 )(http://www.robots.ox.ac.uk/~vgg/data/ owers/102/)
$ brew tap hhatto/otama
$ brew install otama
$ pip install --upgrade otamapy
image-match
from elasticsearch import Elasticsearch
from image_match.elasticsearch_driver import SignatureES
es = Elasticsearch()
ses = SignatureES(es)
for filename in files:
ses.add_image(filename)
image-match
es = Elasticsearch()
ses = SignatureES(es, size=10, distance_cutoff=0.9)
#for o in ses.search_image(TARGET_FILE, all_orientations=True):
for o in ses.search_image(TARGET_FILE):
print(o)
otama
from otama import Otama
db = Otama.open(config)
db.create_database()
for filename in files:
key = db.insert(filename)
keystore[key] = filename
db.pull()
db.close()
otama
db = Otama(config)
for result in db.search(10, TARGET_FILE):
key = result['id']
print("sim=%.3f, file=%s" % (result['similarity'], keystore[key]))
print(db.exists(key))
otama
otama ( time )
Thank you
Hideo Hattori
Software Enginner, KLab Inc. (Osaka)
@hhatto(http://twitter.com/hhatto)
image-matchの紹介

More Related Content

Viewers also liked

osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)
Hattori Hideo
 
Osakapy 20140313 lt
Osakapy 20140313 ltOsakapy 20140313 lt
Osakapy 20140313 lt
Hattori Hideo
 
Php kansai-2013 lt-slide
Php kansai-2013 lt-slidePhp kansai-2013 lt-slide
Php kansai-2013 lt-slide
Hattori Hideo
 
PEP8 and-autopep8 - PyCon APAC 2013 LT
PEP8 and-autopep8 - PyCon APAC 2013 LTPEP8 and-autopep8 - PyCon APAC 2013 LT
PEP8 and-autopep8 - PyCon APAC 2013 LT
Hattori Hideo
 
Go破壊
Go破壊Go破壊
Go破壊
Hattori Hideo
 

Viewers also liked (6)

osakapy 2014.05 LT
osakapy 2014.05 LTosakapy 2014.05 LT
osakapy 2014.05 LT
 
osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)osakapy 2014.10 LT (CI for Python Project)
osakapy 2014.10 LT (CI for Python Project)
 
Osakapy 20140313 lt
Osakapy 20140313 ltOsakapy 20140313 lt
Osakapy 20140313 lt
 
Php kansai-2013 lt-slide
Php kansai-2013 lt-slidePhp kansai-2013 lt-slide
Php kansai-2013 lt-slide
 
PEP8 and-autopep8 - PyCon APAC 2013 LT
PEP8 and-autopep8 - PyCon APAC 2013 LTPEP8 and-autopep8 - PyCon APAC 2013 LT
PEP8 and-autopep8 - PyCon APAC 2013 LT
 
Go破壊
Go破壊Go破壊
Go破壊
 

Similar to image-matchの紹介

Better Code With Python
Better Code With PythonBetter Code With Python
Better Code With Python
Christoforus Surjoputro
 
Tracing python applications
Tracing python applicationsTracing python applications
Tracing python applications
Nikolay Stoitsev
 
Stock Price Predictor - Python with AI Student Project
Stock Price Predictor - Python with AI Student ProjectStock Price Predictor - Python with AI Student Project
Stock Price Predictor - Python with AI Student Project
aiclub_slides
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django session
Juraj Michálek
 
Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発
Yusuke Muraoka
 
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing MicroservicesUsing Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Docker, Inc.
 
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing MicroservicesUsing Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Kenny Bastani
 
Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...
Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...
Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...
Massimo Menichinelli
 
Princeton RSE Peer network first meeting
Princeton RSE Peer network first meetingPrinceton RSE Peer network first meeting
Princeton RSE Peer network first meeting
Henry Schreiner
 
Python on Science ? Yes, We can.
Python on Science ?   Yes, We can.Python on Science ?   Yes, We can.
Python on Science ? Yes, We can.
Marcel Caraciolo
 
Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013
Erik Bernhardsson
 
Курс Java-2016. Занятие 04 (часть 2). Git и GitHub
Курс Java-2016. Занятие 04 (часть 2). Git и GitHubКурс Java-2016. Занятие 04 (часть 2). Git и GitHub
Курс Java-2016. Занятие 04 (часть 2). Git и GitHub
7bits
 
Bunch of random tech things
Bunch of random tech thingsBunch of random tech things
Bunch of random tech things
John Tubert
 
The mag pi-issue-28-en
The mag pi-issue-28-enThe mag pi-issue-28-en
The mag pi-issue-28-en
Nguyen Nam
 
GitHub Data and Insights
GitHub Data and InsightsGitHub Data and Insights
GitHub Data and Insights
Jeff McAffer
 
Android developing in a wrong way
Android developing in a wrong wayAndroid developing in a wrong way
Android developing in a wrong way
Rahmatollah (Sadra) Isapanah Amlashi
 
Angboard
AngboardAngboard
Angboard
Richard Jones
 
RESTful API Development using Go
RESTful API Development using GoRESTful API Development using Go
RESTful API Development using Go
Baiju Muthukadan
 
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
Dong-hee Na
 
Research plan
Research planResearch plan
Research plan
denaldo2012
 

Similar to image-matchの紹介 (20)

Better Code With Python
Better Code With PythonBetter Code With Python
Better Code With Python
 
Tracing python applications
Tracing python applicationsTracing python applications
Tracing python applications
 
Stock Price Predictor - Python with AI Student Project
Stock Price Predictor - Python with AI Student ProjectStock Price Predictor - Python with AI Student Project
Stock Price Predictor - Python with AI Student Project
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django session
 
Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発
 
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing MicroservicesUsing Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
 
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing MicroservicesUsing Docker, Neo4j, and Spring Cloud for Developing Microservices
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
 
Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...
Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...
Bits+atoms+processes: the influence of code culture on Design @ Cumulus Helsi...
 
Princeton RSE Peer network first meeting
Princeton RSE Peer network first meetingPrinceton RSE Peer network first meeting
Princeton RSE Peer network first meeting
 
Python on Science ? Yes, We can.
Python on Science ?   Yes, We can.Python on Science ?   Yes, We can.
Python on Science ? Yes, We can.
 
Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013
 
Курс Java-2016. Занятие 04 (часть 2). Git и GitHub
Курс Java-2016. Занятие 04 (часть 2). Git и GitHubКурс Java-2016. Занятие 04 (часть 2). Git и GitHub
Курс Java-2016. Занятие 04 (часть 2). Git и GitHub
 
Bunch of random tech things
Bunch of random tech thingsBunch of random tech things
Bunch of random tech things
 
The mag pi-issue-28-en
The mag pi-issue-28-enThe mag pi-issue-28-en
The mag pi-issue-28-en
 
GitHub Data and Insights
GitHub Data and InsightsGitHub Data and Insights
GitHub Data and Insights
 
Android developing in a wrong way
Android developing in a wrong wayAndroid developing in a wrong way
Android developing in a wrong way
 
Angboard
AngboardAngboard
Angboard
 
RESTful API Development using Go
RESTful API Development using GoRESTful API Development using Go
RESTful API Development using Go
 
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
 
Research plan
Research planResearch plan
Research plan
 

Recently uploaded

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 

Recently uploaded (20)

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 

image-matchの紹介