Skip to content

Yeti-Media/rubix-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rubix::Api

Ruby wrapper for Rubix api.

Installation

Add this line to your application's Gemfile:

gem 'rubix-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rubix-api

Usage

First you need to require the gem and you initialize the client by instantiating the Rubix class. To do this you need your access token and you can optionally specify api version and domain.

require 'rubix-api'

client = Rubix.new(access_token, version, domain) # Version and domain are optional

To list categories. client.list_categories

To list patterns you need to pass page_number as the only parameter.

client.list_patterns(2) #where "2" means the page number

To delete patterns you need to pass the pattern_id as the only parameter.

client.delete_pattern(100) #where "100" means the pattern_id

To add a matching pattern you need to pass the file itself or an file url for it, a label, and the category name to which the pattern belongs.

client.add_pattern({file: FIle, remote_file_url: "http://example.com/path/to/scene", label: 'uid', category_name: 'matching'})

To use feature matching, a file or file url is needed, as well as a minimum ratio and a minimum matches amount.

client.feature_matching({file, remote_file_url, mr: 0.9, mma: 150}) 

For OCR, Rubix needs the path to image or the file itself, and optionally, the area to be scanned.

client.ocr({file, remote_file_url, rectangles: [[x1,y1.x2,y2],..,[x1,y1,x2,y2]]}

Contributing

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

About

Rubix API wrapper in Javascript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages