|
16 | 16 |
|
17 | 17 | # Provide images to the IBM Watson™ Visual Recognition service for analysis. The |
18 | 18 | # service detects objects based on a set of images with training data. |
19 | | -# |
20 | | -# **Beta:** The Visual Recognition v4 API and Object Detection model are beta features. |
21 | | -# For more information about beta features, see the [Release |
22 | | -# notes](https://cloud.ibm.com/docs/services/visual-recognition?topic=visual-recognition-release-notes#beta). |
23 | | -# {: important} |
24 | 19 |
|
25 | 20 | require "concurrent" |
26 | 21 | require "erb" |
@@ -503,7 +498,9 @@ def delete_image(collection_id:, image_id:) |
503 | 498 | # Download a JPEG representation of an image. |
504 | 499 | # @param collection_id [String] The identifier of the collection. |
505 | 500 | # @param image_id [String] The identifier of the image. |
506 | | - # @param size [String] Specify the image size. |
| 501 | + # @param size [String] The image size. Specify `thumbnail` to return a version that maintains the |
| 502 | + # original aspect ratio but is no larger than 200 pixels in the larger dimension. |
| 503 | + # For example, an original 800 x 1000 image is resized to 160 x 200 pixels. |
507 | 504 | # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. |
508 | 505 | def get_jpeg_image(collection_id:, image_id:, size: nil) |
509 | 506 | raise ArgumentError.new("collection_id must be provided") if collection_id.nil? |
@@ -614,6 +611,42 @@ def add_image_training_data(collection_id:, image_id:, objects: nil) |
614 | 611 | ) |
615 | 612 | response |
616 | 613 | end |
| 614 | + |
| 615 | + ## |
| 616 | + # @!method get_training_usage(start_time: nil, end_time: nil) |
| 617 | + # Get training usage. |
| 618 | + # Information about the completed training events. You can use this information to |
| 619 | + # determine how close you are to the training limits for the month. |
| 620 | + # @param start_time [String] The earliest day to include training events. Specify dates in YYYY-MM-DD format. |
| 621 | + # If empty or not specified, the earliest training event is included. |
| 622 | + # @param end_time [String] The most recent day to include training events. Specify dates in YYYY-MM-DD |
| 623 | + # format. All events for the day are included. If empty or not specified, the |
| 624 | + # current day is used. Specify the same value as `start_time` to request events for |
| 625 | + # a single day. |
| 626 | + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. |
| 627 | + def get_training_usage(start_time: nil, end_time: nil) |
| 628 | + headers = { |
| 629 | + } |
| 630 | + sdk_headers = Common.new.get_sdk_headers("watson_vision_combined", "V4", "get_training_usage") |
| 631 | + headers.merge!(sdk_headers) |
| 632 | + |
| 633 | + params = { |
| 634 | + "version" => @version, |
| 635 | + "start_time" => start_time, |
| 636 | + "end_time" => end_time |
| 637 | + } |
| 638 | + |
| 639 | + method_url = "/v4/training_usage" |
| 640 | + |
| 641 | + response = request( |
| 642 | + method: "GET", |
| 643 | + url: method_url, |
| 644 | + headers: headers, |
| 645 | + params: params, |
| 646 | + accept_json: true |
| 647 | + ) |
| 648 | + response |
| 649 | + end |
617 | 650 | ######################### |
618 | 651 | # User data |
619 | 652 | ######################### |
|
0 commit comments