All Projects → dsys → Match

dsys / Match

Licence: other
🔮 Scalable reverse image search built on Kubernetes and Elasticsearch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Match

Mysql Es
Sync MySQL to ElasticSearch, Support Relationship
Stars: ✭ 53 (-95.27%)
Mutual labels:  elasticsearch
Nodbi
Document DBI connector for R
Stars: ✭ 56 (-95%)
Mutual labels:  elasticsearch
Redmine elasticsearch
Full text searching plugin for Redmine
Stars: ✭ 58 (-94.83%)
Mutual labels:  elasticsearch
Quicknote
QuckNote allows you to quickly create and search tens of thousands of short notes.
Stars: ✭ 54 (-95.18%)
Mutual labels:  elasticsearch
Vertexium
High-security graph database
Stars: ✭ 55 (-95.09%)
Mutual labels:  elasticsearch
Prometheus Es Adapter
Prometheus remote storage adapter for Elasticsearch
Stars: ✭ 57 (-94.92%)
Mutual labels:  elasticsearch
Elasticsearch Synonyms
Curated synonym files and Helpers for Elasticsearch Synonym Token Filter
Stars: ✭ 51 (-95.45%)
Mutual labels:  elasticsearch
Terraform Kubernetes
Terraform module for provisioning AWS resources to run a Kubernetes cluster
Stars: ✭ 61 (-94.56%)
Mutual labels:  kubernetes-cluster
Flume Canal Source
Flume NG Canal source
Stars: ✭ 56 (-95%)
Mutual labels:  elasticsearch
Wp Rest Api Log
WordPress plugin for logging REST API requests and responses
Stars: ✭ 58 (-94.83%)
Mutual labels:  elasticsearch
Aspnetcorenlog
ASP.NET Core NLog MS SQL Server PostgreSQL MySQL Elasticsearch
Stars: ✭ 54 (-95.18%)
Mutual labels:  elasticsearch
Tensorflow Kubernetes Art Classification
Train a TensorFlow model on Kubernetes to recognize art culture based on the collection from the Metropolitan Museum of Art
Stars: ✭ 55 (-95.09%)
Mutual labels:  kubernetes-cluster
Bodybuilder
An elasticsearch query body builder 💪
Stars: ✭ 1,093 (-2.5%)
Mutual labels:  elasticsearch
Geoportal Server Catalog
Geoportal Server next generation search application and metadata catalog, based on elasticsearch.
Stars: ✭ 53 (-95.27%)
Mutual labels:  elasticsearch
Vulnwhisperer
Create actionable data from your Vulnerability Scans
Stars: ✭ 1,102 (-1.69%)
Mutual labels:  elasticsearch
Raspbernetes
Raspberry Pi Kubernetes Cluster
Stars: ✭ 53 (-95.27%)
Mutual labels:  kubernetes-cluster
Booksearch
一个基于Elasticsearch本地文档搜索引擎
Stars: ✭ 56 (-95%)
Mutual labels:  elasticsearch
Aws Config To Elasticsearch
Generates an AWS Config Snapshot and ingests it into ElasticSearch for further analysis using Kibana
Stars: ✭ 62 (-94.47%)
Mutual labels:  elasticsearch
Kubemq
KubeMQ is Enterprise-grade message broker native for Docker and Kubernetes
Stars: ✭ 58 (-94.83%)
Mutual labels:  kubernetes-cluster
Pivot Kibana
Flexmonster Pivot plugin for Kibana
Stars: ✭ 58 (-94.83%)
Mutual labels:  elasticsearch

logo

Scalable reverse image search
built on Kubernetes and Elasticsearch

GitHub stars Docker Pulls Kubernetes shield

Match makes it easy to search for images that look similar to each other. Using a state-of-the-art perceptual hash, it is invariant to scaling and 90 degree rotations. Its HTTP API is quick to integrate and flexible for a number of reverse image search applications. Kubernetes and Elasticsearch allow Match to scale to billions of images with ease while giving you full control over where your data is stored. Match uses the awesome ascribe/image-match under the hood for most of the image search legwork.

  1. Getting Started
  2. API
  3. Development
  4. License and Acknowledgements

Getting Started

If you already have ElasticSearch running:

$ docker run -e ELASTICSEARCH_URL=https://daisy.us-west-1.es.amazonaws.com -it dsys/match

If you want to run ElasticSearch locally as well, have docker-compose installed on your system, clone this repository and type:

$ make dev

Match is packaged as a Docker container (dsys/match on Docker Hub), making it highly portable and scalable to billions of images. You can configure a few options using environment variables:

  • WORKER_COUNT (default: 4)

    The number of gunicorn workers to spin up.

  • ELASTICSEARCH_URL (default: elasticsearch:9200)

    A URL pointing to the Elasticsearch database where image signatures are to be stored. If you don't want to host your own Elasticsearch cluster, consider using AWS Elasticsearch Service. That's what we use.

  • ELASTICSEARCH_INDEX (default: images)

    The index in the Elasticsearch database where image signatures are to be stored.

  • ELASTICSEARCH_DOC_TYPE (default: images)

    The doc type used for storing image signatures.

Using in your own Kubernetes cluster

You can configure the service, replication controller, and secret like so:

# match-service.yml
apiVersion: v1
kind: Service
metadata:
  name: match
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
  selector:
    app: match
# match-rc.yml
apiVersion: v1
kind: ReplicationController
metadata:
  name: match
spec:
  replicas: 1
  selector:
    app: match
  template:
    metadata:
      labels:
        app: match
    spec:
      containers:
      - name: match
        image: dsys/match:latest
        ports:
        - containerPort: 80
        env:
        - name: WORKER_COUNT
          value: "4"
        - name: ELASTICSEARCH_URL
          valueFrom:
            secretKeyRef:
              name: match
              key: elasticsearch.url
        - name: ELASTICSEARCH_INDEX
          valueFrom:
            secretKeyRef:
              name: match
              key: elasticsearch.index
        - name: ELASTICSEARCH_DOC_TYPE
          valueFrom:
            secretKeyRef:
              name: match
              key: elasticsearch.doc-type
# match-secret.yml
apiVersion: v1
kind: Secret
metadata:
  name: match
data:
  # https://daisy.us-west-1.es.amazonaws.com (change me)
  elasticsearch.url: aHR0cHM6Ly9kYWlzeS51cy13ZXN0LTEuZXMuYW1hem9uYXdzLmNvbQ==

  # images
  elasticsearch.index: aW1hZ2Vz

  # images
  elasticsearch.doc-type: aW1hZ2Vz

API

Match has a simple HTTP API. All request parameters are specified via application/x-www-form-urlencoded or multipart/form-data.


POST /add

Adds an image signature to the database.

Parameters

  • url or image (required)

    The image to add to the database. It may be provided as a URL via url or as a multipart/form-data file upload via image.

  • filepath (required)

    The path to save the image to in the database. If another image already exists at the given path, it will be overwritten.

  • metadata (default: None)

    An arbitrary JSON object featuring meta data to attach to the image.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "add",
  "result": []
}

DELETE /delete

Deletes an image signature from the database.

Parameters

  • filepath (required)

    The path of the image signature in the database.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "delete",
  "result": []
}

POST /search

Searches for a similar image in the database. Scores range from 0 to 100, with 100 being a perfect match.

Parameters

  • url or image (required)

    The image to add to the database. It may be provided as a URL via url or as a multipart/form-data file upload via image.

  • all_orientations (default: true)

    Whether or not to search for similar 90 degree rotations of the image.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "search",
  "result": [
    {
      "score": 99.0,
      "filepath": "http://static.wixstatic.com/media/0149b5_345c8f862e914a80bcfcc98fcd432e97.jpg_srz_614_709_85_22_0.50_1.20_0.00_jpg_srz"
    }
  ]
}

POST /compare

Compares two images, returning a score for their similarity. Scores range from 0 to 100, with 100 being a perfect match.

Parameters

  • url1 or image1, url2 or image2 (required)

    The images to compare. They may be provided as a URL via url1/url2 or as a multipart/form-data file upload via image1/image2.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "compare",
  "result": [
    {
      "score": 99.0
    }
  ]
}

GET /count

Count the number of image signatures in the database.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "list",
  "result": [420]
}

GET /list

Lists the file paths for the image signatures in the database.

Parameters

  • offset (default: 0)

    The location in the database to begin listing image paths.

  • limit (default: 20)

    The number of image paths to retrieve.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "list",
  "result": [
    "http://img.youtube.com/vi/iqPqylKy-bY/0.jpg",
    "https://i.ytimg.com/vi/zbjIwBggt2k/hqdefault.jpg",
    "https://s-media-cache-ak0.pinimg.com/736x/3d/67/6d/3d676d3f7f3031c9fd91c10b17d56afe.jpg"
  ]
}

GET /ping

Check for the health of the server.

Example Response

{
  "status": "ok",
  "error": [],
  "method": "ping",
  "result": []
}

Development

$ export ELASTICSEARCH_URL=https://daisy.us-west-1.es.amazonaws.com
$ make build
$ make run
$ make push

License and Acknowledgements

Match is based on ascribe/image-match, which is in turn based on the paper An image signature for any kind of image, Goldberg et al. There is an existing reference implementation which may be more suited to your needs.

Match itself is released under the BSD 3-Clause license. ascribe/image-match is released under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].