ai tags: add autotagger API client.
Add API client for https://github.com/danbooru/autotagger service.
This commit is contained in:
@@ -38,6 +38,14 @@ class MockServicesController < ApplicationController
|
||||
render json: @data
|
||||
end
|
||||
|
||||
def autotagger_evaluate
|
||||
limit = params.fetch(:limit, 50)
|
||||
predictions = tags(limit).pluck(:name).map { |name| [name, rand(0.0..1.0)] }.to_h
|
||||
data = { filename: "test.jpg", tags: predictions }
|
||||
|
||||
render json: data
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def posts(limit = 10)
|
||||
|
||||
Reference in New Issue
Block a user