Add this line to your application's Gemfile:
gem 'youtu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install youtu
Run the generator
rails g youtu:install
rails g youtu:install
will generated the youtu.rb intializer file in config/initializers/youtu.rb
Signature's default store is File storage,but you can using Redis to store signature(optional)
rails g youtu:redis_store
rails g youtu:install
will generated the youtu.rb initializer file in config/initializers/youtu_redis_store.rb
And then you can refer to the following example to use it.
image_url_params = {
url: "imagePath"
mode: 1
}
Youtu::Request.post("/youtu/api/detectface",image_url_params) do |response,request,result|
data = JSON.parse(response.body)
end
For more infomation, please read https://open.youtu.qq.com/welcome/developer#/api-summary
Bug reports and pull requests are welcome on GitHub at https://github.com/gaogao1030/youtu.