From 46a922dc72d806e337c2365b1e42896e76434fba Mon Sep 17 00:00:00 2001 From: Yvette Zhang Date: Wed, 31 May 2023 14:52:48 -0400 Subject: [PATCH] Version 9.5.0 --- VERSION | 2 +- src/Clarifai/Api/AnnotationDataType.php | 68 ++++++++ src/Clarifai/Api/BulkOperation.php | 28 ++++ src/Clarifai/Api/DatasetSplit.php | 120 ++++++++++++++ src/Clarifai/Api/EvalTestSetEntry.php | 71 -------- src/Clarifai/Api/GetVideoManifestRequest.php | 95 +++++++++++ src/Clarifai/Api/GetVideoManifestResponse.php | 95 +++++++++++ src/Clarifai/Api/Operation.php | 28 ++++ src/Clarifai/Api/SplitIntoDatasets.php | 85 ++++++++++ .../SplitIntoDatasets/DatasetSplitMethod.php | 53 ++++++ .../SplitIntoDatasets_DatasetSplitMethod.php | 16 ++ src/Clarifai/Api/Status/StatusCode.php | 8 +- src/Clarifai/Api/Task.php | 72 ++++++++ src/Clarifai/Api/TaskConcept.php | 112 +++++++++++++ .../Api/TaskConceptAutoAnnotationConfig.php | 151 +++++++++++++++++ src/Clarifai/Api/TaskWorker.php | 68 ++++++++ src/Clarifai/Api/ThresholdRange.php | 154 ++++++++++++++++++ src/Clarifai/Api/V2Client.php | 20 ++- .../Proto/Clarifai/Api/Resources.php | Bin 36521 -> 37716 bytes .../Proto/Clarifai/Api/Service.php | Bin 89477 -> 89924 bytes .../Proto/Clarifai/Api/Status/StatusCode.php | Bin 11135 -> 11143 bytes 21 files changed, 1169 insertions(+), 77 deletions(-) create mode 100644 src/Clarifai/Api/AnnotationDataType.php create mode 100644 src/Clarifai/Api/DatasetSplit.php create mode 100644 src/Clarifai/Api/GetVideoManifestRequest.php create mode 100644 src/Clarifai/Api/GetVideoManifestResponse.php create mode 100644 src/Clarifai/Api/SplitIntoDatasets.php create mode 100644 src/Clarifai/Api/SplitIntoDatasets/DatasetSplitMethod.php create mode 100644 src/Clarifai/Api/SplitIntoDatasets_DatasetSplitMethod.php create mode 100644 src/Clarifai/Api/TaskConcept.php create mode 100644 src/Clarifai/Api/TaskConceptAutoAnnotationConfig.php create mode 100644 src/Clarifai/Api/ThresholdRange.php diff --git a/VERSION b/VERSION index 8148c55..d223b45 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.4.0 +9.5.0 diff --git a/src/Clarifai/Api/AnnotationDataType.php b/src/Clarifai/Api/AnnotationDataType.php new file mode 100644 index 0000000..632e867 --- /dev/null +++ b/src/Clarifai/Api/AnnotationDataType.php @@ -0,0 +1,68 @@ +clarifai.api.AnnotationDataType + */ +class AnnotationDataType +{ + /** + * Generated from protobuf enum ANNOTATION_DATA_TYPE_NOT_SET = 0; + */ + const ANNOTATION_DATA_TYPE_NOT_SET = 0; + /** + * Generated from protobuf enum BOUNDING_BOX = 1; + */ + const BOUNDING_BOX = 1; + /** + * Generated from protobuf enum POLYGON = 2; + */ + const POLYGON = 2; + /** + * Generated from protobuf enum POINT = 4; + */ + const POINT = 4; + /** + * Generated from protobuf enum SPAN = 8; + */ + const SPAN = 8; + /** + * Generated from protobuf enum MASK = 16; + */ + const MASK = 16; + + private static $valueToName = [ + self::ANNOTATION_DATA_TYPE_NOT_SET => 'ANNOTATION_DATA_TYPE_NOT_SET', + self::BOUNDING_BOX => 'BOUNDING_BOX', + self::POLYGON => 'POLYGON', + self::POINT => 'POINT', + self::SPAN => 'SPAN', + self::MASK => 'MASK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/src/Clarifai/Api/BulkOperation.php b/src/Clarifai/Api/BulkOperation.php index 0d7ea65..454b5e9 100644 --- a/src/Clarifai/Api/BulkOperation.php +++ b/src/Clarifai/Api/BulkOperation.php @@ -77,6 +77,7 @@ class BulkOperation extends \Google\Protobuf\Internal\Message * id of the Bulk Operation task * @type \Clarifai\Api\InputIDs $input_ids * @type \Clarifai\Api\Search $search + * @type \Clarifai\Api\Dataset $dataset * @type \Clarifai\Api\Operation $operation * Operation to perform * @type string $app_id @@ -182,6 +183,33 @@ public function setSearch($var) return $this; } + /** + * Generated from protobuf field .clarifai.api.Dataset dataset = 11; + * @return \Clarifai\Api\Dataset|null + */ + public function getDataset() + { + return $this->readOneof(11); + } + + public function hasDataset() + { + return $this->hasOneof(11); + } + + /** + * Generated from protobuf field .clarifai.api.Dataset dataset = 11; + * @param \Clarifai\Api\Dataset $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Dataset::class); + $this->writeOneof(11, $var); + + return $this; + } + /** * Operation to perform * diff --git a/src/Clarifai/Api/DatasetSplit.php b/src/Clarifai/Api/DatasetSplit.php new file mode 100644 index 0000000..abe14b4 --- /dev/null +++ b/src/Clarifai/Api/DatasetSplit.php @@ -0,0 +1,120 @@ +clarifai.api.DatasetSplit + */ +class DatasetSplit extends \Google\Protobuf\Internal\Message +{ + /** + * Expected to have ID + * + * Generated from protobuf field .clarifai.api.Dataset dataset = 1; + */ + protected $dataset = null; + protected $method_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\Dataset $dataset + * Expected to have ID + * @type int $percentage + * For RANDOM_PERCENTAGE_SPLIT. + * Values from (0,100] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Expected to have ID + * + * Generated from protobuf field .clarifai.api.Dataset dataset = 1; + * @return \Clarifai\Api\Dataset|null + */ + public function getDataset() + { + return $this->dataset; + } + + public function hasDataset() + { + return isset($this->dataset); + } + + public function clearDataset() + { + unset($this->dataset); + } + + /** + * Expected to have ID + * + * Generated from protobuf field .clarifai.api.Dataset dataset = 1; + * @param \Clarifai\Api\Dataset $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Dataset::class); + $this->dataset = $var; + + return $this; + } + + /** + * For RANDOM_PERCENTAGE_SPLIT. + * Values from (0,100] + * + * Generated from protobuf field uint32 percentage = 2; + * @return int + */ + public function getPercentage() + { + return $this->readOneof(2); + } + + public function hasPercentage() + { + return $this->hasOneof(2); + } + + /** + * For RANDOM_PERCENTAGE_SPLIT. + * Values from (0,100] + * + * Generated from protobuf field uint32 percentage = 2; + * @param int $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkUint32($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getMethodInfo() + { + return $this->whichOneof("method_info"); + } + +} + diff --git a/src/Clarifai/Api/EvalTestSetEntry.php b/src/Clarifai/Api/EvalTestSetEntry.php index 13cf49c..88b3032 100644 --- a/src/Clarifai/Api/EvalTestSetEntry.php +++ b/src/Clarifai/Api/EvalTestSetEntry.php @@ -15,18 +15,6 @@ */ class EvalTestSetEntry extends \Google\Protobuf\Internal\Message { - /** - * Input CFID - * - * Generated from protobuf field string id = 1 [deprecated = true]; - * @deprecated - */ - protected $id = ''; - /** - * Generated from protobuf field string url = 2 [deprecated = true]; - * @deprecated - */ - protected $url = ''; /** * the input information * @@ -58,9 +46,6 @@ class EvalTestSetEntry extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type string $id - * Input CFID - * @type string $url * @type \Clarifai\Api\Input $input * the input information * @type array<\Clarifai\Api\Concept>|\Google\Protobuf\Internal\RepeatedField $predicted_concepts @@ -77,62 +62,6 @@ public function __construct($data = NULL) { parent::__construct($data); } - /** - * Input CFID - * - * Generated from protobuf field string id = 1 [deprecated = true]; - * @return string - * @deprecated - */ - public function getId() - { - @trigger_error('id is deprecated.', E_USER_DEPRECATED); - return $this->id; - } - - /** - * Input CFID - * - * Generated from protobuf field string id = 1 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setId($var) - { - @trigger_error('id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Generated from protobuf field string url = 2 [deprecated = true]; - * @return string - * @deprecated - */ - public function getUrl() - { - @trigger_error('url is deprecated.', E_USER_DEPRECATED); - return $this->url; - } - - /** - * Generated from protobuf field string url = 2 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setUrl($var) - { - @trigger_error('url is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - /** * the input information * diff --git a/src/Clarifai/Api/GetVideoManifestRequest.php b/src/Clarifai/Api/GetVideoManifestRequest.php new file mode 100644 index 0000000..1fe8eb8 --- /dev/null +++ b/src/Clarifai/Api/GetVideoManifestRequest.php @@ -0,0 +1,95 @@ +clarifai.api.GetVideoManifestRequest + */ +class GetVideoManifestRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .clarifai.api.UserAppIDSet user_app_id = 1; + */ + protected $user_app_id = null; + /** + * Generated from protobuf field string input_id = 2; + */ + protected $input_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\UserAppIDSet $user_app_id + * @type string $input_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .clarifai.api.UserAppIDSet user_app_id = 1; + * @return \Clarifai\Api\UserAppIDSet|null + */ + public function getUserAppId() + { + return $this->user_app_id; + } + + public function hasUserAppId() + { + return isset($this->user_app_id); + } + + public function clearUserAppId() + { + unset($this->user_app_id); + } + + /** + * Generated from protobuf field .clarifai.api.UserAppIDSet user_app_id = 1; + * @param \Clarifai\Api\UserAppIDSet $var + * @return $this + */ + public function setUserAppId($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\UserAppIDSet::class); + $this->user_app_id = $var; + + return $this; + } + + /** + * Generated from protobuf field string input_id = 2; + * @return string + */ + public function getInputId() + { + return $this->input_id; + } + + /** + * Generated from protobuf field string input_id = 2; + * @param string $var + * @return $this + */ + public function setInputId($var) + { + GPBUtil::checkString($var, True); + $this->input_id = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/GetVideoManifestResponse.php b/src/Clarifai/Api/GetVideoManifestResponse.php new file mode 100644 index 0000000..b8701b7 --- /dev/null +++ b/src/Clarifai/Api/GetVideoManifestResponse.php @@ -0,0 +1,95 @@ +clarifai.api.GetVideoManifestResponse + */ +class GetVideoManifestResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .clarifai.api.status.Status status = 1; + */ + protected $status = null; + /** + * Generated from protobuf field string manifest_url = 2; + */ + protected $manifest_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\Status\Status $status + * @type string $manifest_url + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .clarifai.api.status.Status status = 1; + * @return \Clarifai\Api\Status\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Generated from protobuf field .clarifai.api.status.Status status = 1; + * @param \Clarifai\Api\Status\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Status\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Generated from protobuf field string manifest_url = 2; + * @return string + */ + public function getManifestUrl() + { + return $this->manifest_url; + } + + /** + * Generated from protobuf field string manifest_url = 2; + * @param string $var + * @return $this + */ + public function setManifestUrl($var) + { + GPBUtil::checkString($var, True); + $this->manifest_url = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/Operation.php b/src/Clarifai/Api/Operation.php index a95d6fc..4223c09 100644 --- a/src/Clarifai/Api/Operation.php +++ b/src/Clarifai/Api/Operation.php @@ -29,6 +29,7 @@ class Operation extends \Google\Protobuf\Internal\Message * @type \Clarifai\Api\DeleteGeo $delete_geo * @type \Clarifai\Api\DeleteFromDataset $delete_from_dataset * @type \Clarifai\Api\AddToDataset $add_to_dataset + * @type \Clarifai\Api\SplitIntoDatasets $split_into_datasets * } */ public function __construct($data = NULL) { @@ -252,6 +253,33 @@ public function setAddToDataset($var) return $this; } + /** + * Generated from protobuf field .clarifai.api.SplitIntoDatasets split_into_datasets = 9; + * @return \Clarifai\Api\SplitIntoDatasets|null + */ + public function getSplitIntoDatasets() + { + return $this->readOneof(9); + } + + public function hasSplitIntoDatasets() + { + return $this->hasOneof(9); + } + + /** + * Generated from protobuf field .clarifai.api.SplitIntoDatasets split_into_datasets = 9; + * @param \Clarifai\Api\SplitIntoDatasets $var + * @return $this + */ + public function setSplitIntoDatasets($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\SplitIntoDatasets::class); + $this->writeOneof(9, $var); + + return $this; + } + /** * @return string */ diff --git a/src/Clarifai/Api/SplitIntoDatasets.php b/src/Clarifai/Api/SplitIntoDatasets.php new file mode 100644 index 0000000..abd5a5c --- /dev/null +++ b/src/Clarifai/Api/SplitIntoDatasets.php @@ -0,0 +1,85 @@ +clarifai.api.SplitIntoDatasets + */ +class SplitIntoDatasets extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .clarifai.api.DatasetSplit dataset_splits = 1; + */ + private $dataset_splits; + /** + * Generated from protobuf field .clarifai.api.SplitIntoDatasets.DatasetSplitMethod method = 2; + */ + protected $method = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Clarifai\Api\DatasetSplit>|\Google\Protobuf\Internal\RepeatedField $dataset_splits + * @type int $method + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .clarifai.api.DatasetSplit dataset_splits = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasetSplits() + { + return $this->dataset_splits; + } + + /** + * Generated from protobuf field repeated .clarifai.api.DatasetSplit dataset_splits = 1; + * @param array<\Clarifai\Api\DatasetSplit>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasetSplits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\DatasetSplit::class); + $this->dataset_splits = $arr; + + return $this; + } + + /** + * Generated from protobuf field .clarifai.api.SplitIntoDatasets.DatasetSplitMethod method = 2; + * @return int + */ + public function getMethod() + { + return $this->method; + } + + /** + * Generated from protobuf field .clarifai.api.SplitIntoDatasets.DatasetSplitMethod method = 2; + * @param int $var + * @return $this + */ + public function setMethod($var) + { + GPBUtil::checkEnum($var, \Clarifai\Api\SplitIntoDatasets\DatasetSplitMethod::class); + $this->method = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/SplitIntoDatasets/DatasetSplitMethod.php b/src/Clarifai/Api/SplitIntoDatasets/DatasetSplitMethod.php new file mode 100644 index 0000000..238aac0 --- /dev/null +++ b/src/Clarifai/Api/SplitIntoDatasets/DatasetSplitMethod.php @@ -0,0 +1,53 @@ +clarifai.api.SplitIntoDatasets.DatasetSplitMethod + */ +class DatasetSplitMethod +{ + /** + * Generated from protobuf enum NOT_SET = 0; + */ + const NOT_SET = 0; + /** + * We will randomly split inputs into the datasets + * + * Generated from protobuf enum RANDOM_PERCENTAGE_SPLIT = 1; + */ + const RANDOM_PERCENTAGE_SPLIT = 1; + + private static $valueToName = [ + self::NOT_SET => 'NOT_SET', + self::RANDOM_PERCENTAGE_SPLIT => 'RANDOM_PERCENTAGE_SPLIT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatasetSplitMethod::class, \Clarifai\Api\SplitIntoDatasets_DatasetSplitMethod::class); + diff --git a/src/Clarifai/Api/SplitIntoDatasets_DatasetSplitMethod.php b/src/Clarifai/Api/SplitIntoDatasets_DatasetSplitMethod.php new file mode 100644 index 0000000..96ccabe --- /dev/null +++ b/src/Clarifai/Api/SplitIntoDatasets_DatasetSplitMethod.php @@ -0,0 +1,16 @@ +DATA_DUMP_NO_DATA = 25154; + * DEPRECATED: Not used anymore. Now for an empty data dump, DATA_DUMP_SUCCESS is returned. To detect an empty data dump, check if the inptus count is 0. + * + * Generated from protobuf enum DATA_DUMP_NO_DATA = 25154 [deprecated = true]; */ const DATA_DUMP_NO_DATA = 25154; /** @@ -834,7 +836,9 @@ class StatusCode */ const REQUEST_DISABLED_FOR_MAINTENANCE = 39997; /** - * Generated from protobuf enum INPUT_WRITES_DISABLED_FOR_MAINTENANCE = 39998; + * deprecate this one. Use REQUEST_DISABLED_FOR_MAINTENANCE + * + * Generated from protobuf enum INPUT_WRITES_DISABLED_FOR_MAINTENANCE = 39998 [deprecated = true]; */ const INPUT_WRITES_DISABLED_FOR_MAINTENANCE = 39998; /** diff --git a/src/Clarifai/Api/Task.php b/src/Clarifai/Api/Task.php index 7cd2094..2c00f3d 100644 --- a/src/Clarifai/Api/Task.php +++ b/src/Clarifai/Api/Task.php @@ -127,6 +127,19 @@ class Task extends \Google\Protobuf\Internal\Message * Generated from protobuf field string label_order_id = 18; */ protected $label_order_id = ''; + /** + * Ignore Task.concept_ids field if Task.TaskConcept are supplied. + * + * Generated from protobuf field repeated .clarifai.api.TaskConcept concepts = 19; + */ + private $concepts; + /** + * Specify whether existing Annotations within the same app that are generated by other auto annotation tasks + * with the specified Concept from the selected Model or Workflow should deleted before executing the Task + * + * Generated from protobuf field bool delete_previous_annotations = 20; + */ + protected $delete_previous_annotations = false; /** * Constructor. @@ -175,6 +188,11 @@ class Task extends \Google\Protobuf\Internal\Message * The user the task belongs to. * @type string $label_order_id * The label order the task belongs to. + * @type array<\Clarifai\Api\TaskConcept>|\Google\Protobuf\Internal\RepeatedField $concepts + * Ignore Task.concept_ids field if Task.TaskConcept are supplied. + * @type bool $delete_previous_annotations + * Specify whether existing Annotations within the same app that are generated by other auto annotation tasks + * with the specified Concept from the selected Model or Workflow should deleted before executing the Task * } */ public function __construct($data = NULL) { @@ -748,5 +766,59 @@ public function setLabelOrderId($var) return $this; } + /** + * Ignore Task.concept_ids field if Task.TaskConcept are supplied. + * + * Generated from protobuf field repeated .clarifai.api.TaskConcept concepts = 19; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConcepts() + { + return $this->concepts; + } + + /** + * Ignore Task.concept_ids field if Task.TaskConcept are supplied. + * + * Generated from protobuf field repeated .clarifai.api.TaskConcept concepts = 19; + * @param array<\Clarifai\Api\TaskConcept>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConcepts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\TaskConcept::class); + $this->concepts = $arr; + + return $this; + } + + /** + * Specify whether existing Annotations within the same app that are generated by other auto annotation tasks + * with the specified Concept from the selected Model or Workflow should deleted before executing the Task + * + * Generated from protobuf field bool delete_previous_annotations = 20; + * @return bool + */ + public function getDeletePreviousAnnotations() + { + return $this->delete_previous_annotations; + } + + /** + * Specify whether existing Annotations within the same app that are generated by other auto annotation tasks + * with the specified Concept from the selected Model or Workflow should deleted before executing the Task + * + * Generated from protobuf field bool delete_previous_annotations = 20; + * @param bool $var + * @return $this + */ + public function setDeletePreviousAnnotations($var) + { + GPBUtil::checkBool($var); + $this->delete_previous_annotations = $var; + + return $this; + } + } diff --git a/src/Clarifai/Api/TaskConcept.php b/src/Clarifai/Api/TaskConcept.php new file mode 100644 index 0000000..50b8b0e --- /dev/null +++ b/src/Clarifai/Api/TaskConcept.php @@ -0,0 +1,112 @@ +clarifai.api.TaskConcept + */ +class TaskConcept extends \Google\Protobuf\Internal\Message +{ + /** + * For auto annotation, id/name and value, user + app id must be specified. For other tasks, only the id field is required. + * + * Generated from protobuf field .clarifai.api.Concept concept = 1; + */ + protected $concept = null; + /** + * Generated from protobuf field .clarifai.api.TaskConceptAutoAnnotationConfig auto_annotation_config = 2; + */ + protected $auto_annotation_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\Concept $concept + * For auto annotation, id/name and value, user + app id must be specified. For other tasks, only the id field is required. + * @type \Clarifai\Api\TaskConceptAutoAnnotationConfig $auto_annotation_config + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * For auto annotation, id/name and value, user + app id must be specified. For other tasks, only the id field is required. + * + * Generated from protobuf field .clarifai.api.Concept concept = 1; + * @return \Clarifai\Api\Concept|null + */ + public function getConcept() + { + return $this->concept; + } + + public function hasConcept() + { + return isset($this->concept); + } + + public function clearConcept() + { + unset($this->concept); + } + + /** + * For auto annotation, id/name and value, user + app id must be specified. For other tasks, only the id field is required. + * + * Generated from protobuf field .clarifai.api.Concept concept = 1; + * @param \Clarifai\Api\Concept $var + * @return $this + */ + public function setConcept($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Concept::class); + $this->concept = $var; + + return $this; + } + + /** + * Generated from protobuf field .clarifai.api.TaskConceptAutoAnnotationConfig auto_annotation_config = 2; + * @return \Clarifai\Api\TaskConceptAutoAnnotationConfig|null + */ + public function getAutoAnnotationConfig() + { + return $this->auto_annotation_config; + } + + public function hasAutoAnnotationConfig() + { + return isset($this->auto_annotation_config); + } + + public function clearAutoAnnotationConfig() + { + unset($this->auto_annotation_config); + } + + /** + * Generated from protobuf field .clarifai.api.TaskConceptAutoAnnotationConfig auto_annotation_config = 2; + * @param \Clarifai\Api\TaskConceptAutoAnnotationConfig $var + * @return $this + */ + public function setAutoAnnotationConfig($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\TaskConceptAutoAnnotationConfig::class); + $this->auto_annotation_config = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/TaskConceptAutoAnnotationConfig.php b/src/Clarifai/Api/TaskConceptAutoAnnotationConfig.php new file mode 100644 index 0000000..009f95e --- /dev/null +++ b/src/Clarifai/Api/TaskConceptAutoAnnotationConfig.php @@ -0,0 +1,151 @@ +clarifai.api.TaskConceptAutoAnnotationConfig + */ +class TaskConceptAutoAnnotationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Filter anontations by their annotation data type. + * This specifies types in an OR fashion, e.g. a `dog` concept that appears as a mask or a bbox. + * + * Generated from protobuf field uint32 annotation_data_types = 1; + */ + protected $annotation_data_types = 0; + /** + * Filter annotations by concept value. + * Only concepts that fit in the threshold will be used to generate annotations. + * + * Generated from protobuf field .clarifai.api.ThresholdRange threshold_range = 2; + */ + protected $threshold_range = null; + /** + * The output annotations will be created using this status code. + * + * Generated from protobuf field .clarifai.api.status.StatusCode status_code = 3; + */ + protected $status_code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $annotation_data_types + * Filter anontations by their annotation data type. + * This specifies types in an OR fashion, e.g. a `dog` concept that appears as a mask or a bbox. + * @type \Clarifai\Api\ThresholdRange $threshold_range + * Filter annotations by concept value. + * Only concepts that fit in the threshold will be used to generate annotations. + * @type int $status_code + * The output annotations will be created using this status code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Filter anontations by their annotation data type. + * This specifies types in an OR fashion, e.g. a `dog` concept that appears as a mask or a bbox. + * + * Generated from protobuf field uint32 annotation_data_types = 1; + * @return int + */ + public function getAnnotationDataTypes() + { + return $this->annotation_data_types; + } + + /** + * Filter anontations by their annotation data type. + * This specifies types in an OR fashion, e.g. a `dog` concept that appears as a mask or a bbox. + * + * Generated from protobuf field uint32 annotation_data_types = 1; + * @param int $var + * @return $this + */ + public function setAnnotationDataTypes($var) + { + GPBUtil::checkUint32($var); + $this->annotation_data_types = $var; + + return $this; + } + + /** + * Filter annotations by concept value. + * Only concepts that fit in the threshold will be used to generate annotations. + * + * Generated from protobuf field .clarifai.api.ThresholdRange threshold_range = 2; + * @return \Clarifai\Api\ThresholdRange|null + */ + public function getThresholdRange() + { + return $this->threshold_range; + } + + public function hasThresholdRange() + { + return isset($this->threshold_range); + } + + public function clearThresholdRange() + { + unset($this->threshold_range); + } + + /** + * Filter annotations by concept value. + * Only concepts that fit in the threshold will be used to generate annotations. + * + * Generated from protobuf field .clarifai.api.ThresholdRange threshold_range = 2; + * @param \Clarifai\Api\ThresholdRange $var + * @return $this + */ + public function setThresholdRange($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\ThresholdRange::class); + $this->threshold_range = $var; + + return $this; + } + + /** + * The output annotations will be created using this status code. + * + * Generated from protobuf field .clarifai.api.status.StatusCode status_code = 3; + * @return int + */ + public function getStatusCode() + { + return $this->status_code; + } + + /** + * The output annotations will be created using this status code. + * + * Generated from protobuf field .clarifai.api.status.StatusCode status_code = 3; + * @param int $var + * @return $this + */ + public function setStatusCode($var) + { + GPBUtil::checkEnum($var, \Clarifai\Api\Status\StatusCode::class); + $this->status_code = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/TaskWorker.php b/src/Clarifai/Api/TaskWorker.php index 859510a..070c91d 100644 --- a/src/Clarifai/Api/TaskWorker.php +++ b/src/Clarifai/Api/TaskWorker.php @@ -37,6 +37,18 @@ class TaskWorker extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .clarifai.api.User users = 4; */ private $users; + /** + * Models that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * + * Generated from protobuf field repeated .clarifai.api.Model models = 5; + */ + private $models; + /** + * Workflows that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * + * Generated from protobuf field repeated .clarifai.api.Workflow workflows = 6; + */ + private $workflows; protected $strategy_info; /** @@ -54,6 +66,10 @@ class TaskWorker extends \Google\Protobuf\Internal\Message * Users who will work on this task. * When the 'worker.users' field is additionally requested, then all user * info is filled for the workers. Otherwise, only the user 'id' is filled. + * @type array<\Clarifai\Api\Model>|\Google\Protobuf\Internal\RepeatedField $models + * Models that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * @type array<\Clarifai\Api\Workflow>|\Google\Protobuf\Internal\RepeatedField $workflows + * Workflows that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. * @type \Clarifai\Api\TaskWorkerPartitionedStrategyInfo $partitioned_strategy_info * } */ @@ -150,6 +166,58 @@ public function setUsers($var) return $this; } + /** + * Models that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * + * Generated from protobuf field repeated .clarifai.api.Model models = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModels() + { + return $this->models; + } + + /** + * Models that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * + * Generated from protobuf field repeated .clarifai.api.Model models = 5; + * @param array<\Clarifai\Api\Model>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\Model::class); + $this->models = $arr; + + return $this; + } + + /** + * Workflows that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * + * Generated from protobuf field repeated .clarifai.api.Workflow workflows = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkflows() + { + return $this->workflows; + } + + /** + * Workflows that will work on this task. For Auto Annotation Tasks. Currently only supports 1 entry. + * + * Generated from protobuf field repeated .clarifai.api.Workflow workflows = 6; + * @param array<\Clarifai\Api\Workflow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkflows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\Workflow::class); + $this->workflows = $arr; + + return $this; + } + /** * Generated from protobuf field .clarifai.api.TaskWorkerPartitionedStrategyInfo partitioned_strategy_info = 3; * @return \Clarifai\Api\TaskWorkerPartitionedStrategyInfo|null diff --git a/src/Clarifai/Api/ThresholdRange.php b/src/Clarifai/Api/ThresholdRange.php new file mode 100644 index 0000000..ea704db --- /dev/null +++ b/src/Clarifai/Api/ThresholdRange.php @@ -0,0 +1,154 @@ +clarifai.api.ThresholdRange + */ +class ThresholdRange extends \Google\Protobuf\Internal\Message +{ + /** + * The range used to filter over concept values. + * e.g. GREATER_THAN_OR_EQUAL_TO 0.7 -> is_lower_inclusive = true, lower = 0.7, is_upper_inclusive = true, upper = 1.0 + * e.g. (0.3, 0.75] -> is_lower_inclusive = false, lower = 0.3, is_upper_inclusive = true, upper = 0.75 + * + * Generated from protobuf field bool is_lower_inclusive = 1; + */ + protected $is_lower_inclusive = false; + /** + * Generated from protobuf field bool is_upper_inclusive = 2; + */ + protected $is_upper_inclusive = false; + /** + * Generated from protobuf field float lower = 3; + */ + protected $lower = 0.0; + /** + * Generated from protobuf field float upper = 4; + */ + protected $upper = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $is_lower_inclusive + * The range used to filter over concept values. + * e.g. GREATER_THAN_OR_EQUAL_TO 0.7 -> is_lower_inclusive = true, lower = 0.7, is_upper_inclusive = true, upper = 1.0 + * e.g. (0.3, 0.75] -> is_lower_inclusive = false, lower = 0.3, is_upper_inclusive = true, upper = 0.75 + * @type bool $is_upper_inclusive + * @type float $lower + * @type float $upper + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The range used to filter over concept values. + * e.g. GREATER_THAN_OR_EQUAL_TO 0.7 -> is_lower_inclusive = true, lower = 0.7, is_upper_inclusive = true, upper = 1.0 + * e.g. (0.3, 0.75] -> is_lower_inclusive = false, lower = 0.3, is_upper_inclusive = true, upper = 0.75 + * + * Generated from protobuf field bool is_lower_inclusive = 1; + * @return bool + */ + public function getIsLowerInclusive() + { + return $this->is_lower_inclusive; + } + + /** + * The range used to filter over concept values. + * e.g. GREATER_THAN_OR_EQUAL_TO 0.7 -> is_lower_inclusive = true, lower = 0.7, is_upper_inclusive = true, upper = 1.0 + * e.g. (0.3, 0.75] -> is_lower_inclusive = false, lower = 0.3, is_upper_inclusive = true, upper = 0.75 + * + * Generated from protobuf field bool is_lower_inclusive = 1; + * @param bool $var + * @return $this + */ + public function setIsLowerInclusive($var) + { + GPBUtil::checkBool($var); + $this->is_lower_inclusive = $var; + + return $this; + } + + /** + * Generated from protobuf field bool is_upper_inclusive = 2; + * @return bool + */ + public function getIsUpperInclusive() + { + return $this->is_upper_inclusive; + } + + /** + * Generated from protobuf field bool is_upper_inclusive = 2; + * @param bool $var + * @return $this + */ + public function setIsUpperInclusive($var) + { + GPBUtil::checkBool($var); + $this->is_upper_inclusive = $var; + + return $this; + } + + /** + * Generated from protobuf field float lower = 3; + * @return float + */ + public function getLower() + { + return $this->lower; + } + + /** + * Generated from protobuf field float lower = 3; + * @param float $var + * @return $this + */ + public function setLower($var) + { + GPBUtil::checkFloat($var); + $this->lower = $var; + + return $this; + } + + /** + * Generated from protobuf field float upper = 4; + * @return float + */ + public function getUpper() + { + return $this->upper; + } + + /** + * Generated from protobuf field float upper = 4; + * @param float $var + * @return $this + */ + public function setUpper($var) + { + GPBUtil::checkFloat($var); + $this->upper = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/V2Client.php b/src/Clarifai/Api/V2Client.php index f368823..854d6eb 100644 --- a/src/Clarifai/Api/V2Client.php +++ b/src/Clarifai/Api/V2Client.php @@ -489,6 +489,21 @@ public function GetInput(\Clarifai\Api\GetInputRequest $argument, $metadata, $options); } + /** + * Get a video input manifest. + * @param \Clarifai\Api\GetVideoManifestRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetInputVideoManifest(\Clarifai\Api\GetVideoManifestRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/clarifai.api.V2/GetInputVideoManifest', + $argument, + ['\Clarifai\Api\GetVideoManifestResponse', 'decode'], + $metadata, $options); + } + /** * List all the inputs. * @param \Clarifai\Api\ListInputsRequest $argument input argument @@ -505,9 +520,8 @@ public function ListInputs(\Clarifai\Api\ListInputsRequest $argument, } /** - * Add an input (or set of inputs) to an app. - * This call is synchronous if the PostInputsRequest contains exactly one image input. Otherwise, - * it is asynchronous. + * Add 1 or more input to an app. + * The actual inputs processing is asynchronous. * @param \Clarifai\Api\PostInputsRequest $argument input argument * @param array $metadata metadata * @param array $options call options diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Resources.php b/src/GPBMetadata/Proto/Clarifai/Api/Resources.php index 1aea9bf6845432d145580e1b53419a3cdba26f87..8d3ca86adb43ea45fc8f1c7f587cc912805b4faa 100644 GIT binary patch delta 1172 zcmZWn!Ee)69OgN3oBom(_ciT2TGlSrpe-nsBACQsm7F%~0@RKYPg*sQv67e8!m~5K zmsSx>;jmpM(1d*Aut~dYV$!q;A3#D}Ie>&TiOc?n-MRAo?252nY(M|L_xrx@_xm3H zEWQ3s`dgN!Tg+yCdM$Zv`W+HZXO_di&`cytcai+-FA|jQUnzx8GAGZU>jggZ*W0cg zI9=OWw|mYy75CGZ)#eS#0u?>a7}esx2$b4^?V5zL7GX7y1%vSN=T8flvpJ+l{3$7! zNZuZNBt0IB?vO*NiO)f(Lxs*VZDxp49NT%U_GiBWI(=qBq`y0(u0>2afvL2cB?#iV#tA$XYHPDYfyY%IA;R|kju`D!rSkr0k2Ni)#GV>)vB4w2|N!UG&Oz8*s&V5=4MSdwX@qbtJSz#Hx*R+8VaKg;$5V| z#V*9mKEXu*p2Ifrn4KnJ@{1GINysM#`1rbh^yujz7 delta 152 zcmcbzjA`XurVXr2n|+vi7@77?oqUVgWV1DkpOfi3MlJ!@vc#N_)Z&uh)DqXclA=l> zJ}#!r6bVKJMh#9UCJ9C%elF(Hq8te(n84(@Zo4<9xL3+CJ!Rc|Kee1`@`{X$O#7K8 zS7)|v4#--`x_L(73?9bb$%b`Bo6pvjF*2QE-t5}2mvOUG({#qoEUg+mn-@*o#0UVR CGBh^; diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Service.php b/src/GPBMetadata/Proto/Clarifai/Api/Service.php index cc771d2cc5ae60c5459050c89b92cb729719ee5a..dcc2c079fe7b241d70e98139e3c126018da891b3 100644 GIT binary patch delta 252 zcmZqO&3a@X>jobdrrql{`>~vt6OM`D5_eB63Cm1L&G${r%S=lx-h5GspG7E^O9D-N zvZKDas0bHNE<{;Ld}&dR1d{@z2IuDcYX2*krhVP~V7{ZQ#UDm4QJ_}Oyn<2`b4!F& z^^$WEi!##^GxZV+GWF2SzqnIE1x>6ZD7CmCKd(4dX)D$vwS1N1GAnd{&)hH^Ru3yK^?Q;zGR?%P7|O2 diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php b/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php index 67ee59379983c49ca5d8979cf562d68241983cdc..e55ff654366b108583aff2b8f5ce9babff38b7ef 100644 GIT binary patch delta 56 zcmew#)*im$5hKgZATI5R-rAD|nZy_uZ`NSC&ci4@iC>&qiiu;h7{3w+qyA(|acveL LmvM87xU>iW?q?1Y delta 47 zcmZn<{~xyD5hKgRATI5R-rAD|nZy`pZ`NSC&ci4^iC=uPG`}JTqxNK5aqZ1H;?g1j Df8Y(f