Giter VIP home page Giter VIP logo

redis-imagescout's Introduction

Redis-ImageScout

A Redis module for indexing images. The module accepts precomputed perceptual hashes of images and indexes them for fast efficient retrieval. A perceptual hash is a fingerprint robust to small distortions - such as compression blurr, scaling, etc. Useful for such things as duplicate detection and copyright protection of images.

Installation

Build and run a docker image:

docker build --tag imgscout:0.1 .
docker run --detach --publish 6379:6379 --mount src=imgscoutdata,dst=/data --name imgscout imgscout:0.1

The client demo program requires the following dependencies pre-installed:

libpng-dev
libtiff-dev
libjpeg-dev

The demo also requires the following but the build will automatically install it:

libphash
libhiredis

To build and install the module:

cmake .
make
make install

To load/unload the module into Redis:

module load /usr/local/lib/imgscout.so
module unload imgscout
module list

Or put this in the redis.conf configuration:

loadmodule /var/local/lib/imgscout.so

Module Commands

The Redis-Imagescout module introduces the mvptree datatype with the following commands:

imgscout.add key hashvalue title [id]

adds a new image perceptual hash to the queue for later addition. When the new additions reaches a threshold number, the new arrivals are added to the index in a batch. To add right away, immediately follow up with the sync command. Returns the id integer value assigned to this image. The title string is added as a hash field to the key: key. Optionally, an id integer can be appended to the end of the command, but this is not the normal use.

imgscout.sync key

adds all the recently submitted image perceptual hashes to the index. Returns an OK status message.

imgscout.query key target-hash radius

queries for all perceptual hash targets within a given radius. Returns an array of results. Each item in the array is also an array of two items: the title string and the id integer.

imgscout.lookup key id

looks up an integer id. Returns the title string.

imgscout.size key

Returns the number of entries in the index.

imgscout.del key id

deletes the id from the index. Returns OK status.

Client Demo Program

Use the imgscoutclient utility to add or query the image files in a given directory. Run ./imgscoutclient -h for all the options. After adding files, be sure to run ./imgscoutclient --cmd sync --key mykey to add the recent additions to the index structure.

redis-imagescout's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

redis-imagescout's Issues

Where or how can I run ./imgscoutclient -h

I do not know how to do that... Maybe some steps are missing or should be implied (by me but I don't know)...

 Use the imgscoutclient utility to add or query the image files in a given directory. Run ./imgscoutclient -h for all the options. After adding files, be sure to run ./imgscoutclient --cmd sync --key mykey to add the recent additions to the index structure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.