Class: RunApi::Omnihuman::Resources::HumanIdentification
- Inherits:
-
Object
- Object
- RunApi::Omnihuman::Resources::HumanIdentification
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/omnihuman/resources/human_identification.rb
Overview
Identifies human regions in a source image before video generation.
Constant Summary collapse
- ENDPOINT =
"/api/v1/omnihuman/human_identification"- RESPONSE_CLASS =
Types::HumanIdentificationResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedHumanIdentificationResponse
Instance Method Summary collapse
- #create(options: nil, **params) ⇒ Object
- #get(id, options: nil) ⇒ Object
-
#initialize(http) ⇒ HumanIdentification
constructor
A new instance of HumanIdentification.
- #run(options: nil, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ HumanIdentification
Returns a new instance of HumanIdentification.
14 15 16 |
# File 'lib/runapi/omnihuman/resources/human_identification.rb', line 14 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ Object
23 24 25 26 27 |
# File 'lib/runapi/omnihuman/resources/human_identification.rb', line 23 def create(options: nil, **params) params = compact_params(params) validate_contract!(CONTRACT["human-identification"], params) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ Object
29 30 31 |
# File 'lib/runapi/omnihuman/resources/human_identification.rb', line 29 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ Object
18 19 20 21 |
# File 'lib/runapi/omnihuman/resources/human_identification.rb', line 18 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |