Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrkamel/similarity

Similarity is an optical as well as keyword based image similarity search engine built on top of Lire.
https://github.com/mrkamel/similarity

Last synced: 23 days ago
JSON representation

Similarity is an optical as well as keyword based image similarity search engine built on top of Lire.

Awesome Lists containing this project

README

        

# similarity

Similarity is an image similarity search server built on top of Lire.
The images can be filtered using a query and are afterwards optically ranked.
Similarity provides an easy to use REST interface and returns the search results as XML.
If you're familiar with Ruby and the RestClient gem, check out the following examples.

First, you need to start the server:


$ sh start.sh

## Index and query using cURL

After you started similarity, you can index some images using cURL:


$ curl http://localhost:8984/uploads -F file=@/path/to/file.jpg -F "text=keyword1 keyword2" -F id=1
...

Finally, you can search for similary images:


$ curl http://localhost:8984/search -F file=@/path/to/reference.jpg -F q=keyword1 -F start=0 -F limit=10
<response num="2">
<result>
<id>1</id>
<identifier>/path/to/file.jpg</identifier>
<text>keyword1 keyword2</text>
<score>1.0</score>
</result>
...
</response>

## Index and query using RestClient

After you started similarity, you can index some images using e.g. Ruby and the RestClient gem:


gem install rest-client

$ irb
irb> require "rubygems"
irb> require "rest-client"
irb> RestClient.post("http://localhost:8984/uploads",
:file => File.new("/path/to/file.jpg"), :text => "keyword1 keyword2", :id => 1)
...

Finally, you can search for similar images:


irb> puts RestClient.post("http://localhost:8984/search", :file => File.new("/path/to/reference.jpg"),
:q => "keyword1", :start => 0, :limit => 10)
<response num="2">
<result>
<id>1</id>
<identifier>/path/to/file.jpg</identifier>
<text>keyword1 keyword2</text>
<score>1.0</score>
</result>
...
</response>
=> nil

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request