airflow.providers.google.cloud.hooks.vision¶
此模块包含一个 Google Cloud Vision Hook。
属性¶
类¶
用于确定实体名称的辅助类。 |
|
用于 Google Cloud Vision API 的 Hook。 |
模块内容¶
- airflow.providers.google.cloud.hooks.vision.ERR_DIFF_NAMES = Multiline-String[source]¶
显示值
"""The {label} name provided in the object ({explicit_name}) is different than the name created from the input parameters ({constructed_name}). Please either: 1) Remove the {label} name, 2) Remove the location and {id_label} parameters, 3) Unify the {label} name and input parameters. """
- airflow.providers.google.cloud.hooks.vision.ERR_UNABLE_TO_CREATE = Multiline-String[source]¶
显示值
"""Unable to determine the {label} name. Please either set the name directly in the {label} object or provide the `location` and `{id_label}` parameters. """
- class airflow.providers.google.cloud.hooks.vision.NameDeterminer(label, id_label, get_path)[source]¶
用于确定实体名称的辅助类。
- class airflow.providers.google.cloud.hooks.vision.CloudVisionHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]¶
继承自:
airflow.providers.google.common.hooks.base_google.GoogleBaseHook
用于 Google Cloud Vision API 的 Hook。
Hook 中所有使用 project_id 的方法必须使用关键字参数调用,而不是位置参数。
- get_conn()[source]¶
获取 Cloud Vision 的连接。
- 返回:
Google Cloud Vision 客户端对象。
- 返回类型:
google.cloud.vision_v1.ProductSearchClient
- property annotator_client: google.cloud.vision_v1.ImageAnnotatorClient[source]¶
创建 ImageAnnotatorClient。
- 返回:
Google Image Annotator 客户端对象。
- 返回类型:
google.cloud.vision_v1.ImageAnnotatorClient
- create_product_set(location, product_set, project_id=PROVIDE_PROJECT_ID, product_set_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建产品集。
有关文档,请参阅:
CloudVisionCreateProductSetOperator
。
- get_product_set(location, product_set_id, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取产品集。
有关文档,请参阅:
CloudVisionGetProductSetOperator
。
- update_product_set(product_set, project_id=PROVIDE_PROJECT_ID, location=None, product_set_id=None, update_mask=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
更新产品集。
有关文档,请参阅:
CloudVisionUpdateProductSetOperator
。
- delete_product_set(location, product_set_id, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除产品集。
有关文档,请参阅:
CloudVisionDeleteProductSetOperator
。
- create_product(location, product, project_id=PROVIDE_PROJECT_ID, product_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建产品。
有关文档,请参阅:
CloudVisionCreateProductOperator
。
- get_product(location, product_id, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取产品。
有关文档,请参阅:
CloudVisionGetProductOperator
。
- update_product(product, project_id=PROVIDE_PROJECT_ID, location=None, product_id=None, update_mask=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
更新产品。
有关文档,请参阅:
CloudVisionUpdateProductOperator
。
- delete_product(location, product_id, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除产品。
有关文档,请参阅:
CloudVisionDeleteProductOperator
。
- create_reference_image(location, product_id, reference_image, project_id, reference_image_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建参考图片。
有关文档,请参阅:
CloudVisionCreateReferenceImageOperator
。
- delete_reference_image(location, product_id, reference_image_id, project_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除参考图片。
有关文档,请参阅:
CloudVisionDeleteReferenceImageOperator
。
- add_product_to_product_set(product_set_id, product_id, project_id, location, retry=DEFAULT, timeout=None, metadata=())[source]¶
将产品添加到产品集。
有关文档,请参阅:
CloudVisionAddProductToProductSetOperator
。
- remove_product_from_product_set(product_set_id, product_id, project_id, location, retry=DEFAULT, timeout=None, metadata=())[source]¶
从产品集中移除产品。
有关文档,请参阅:
CloudVisionRemoveProductFromProductSetOperator
。
- annotate_image(request, retry=DEFAULT, timeout=None)[source]¶
对图片进行标注。
有关文档,请参阅:
CloudVisionImageAnnotateOperator
。
- batch_annotate_images(requests, retry=DEFAULT, timeout=None)[source]¶
批量标注图片。
有关文档,请参阅:
CloudVisionImageAnnotateOperator
。
- text_detection(image, max_results=None, retry=DEFAULT, timeout=None, additional_properties=None)[source]¶
文本检测。
有关文档,请参阅:
CloudVisionDetectTextOperator
。
- document_text_detection(image, max_results=None, retry=DEFAULT, timeout=None, additional_properties=None)[source]¶
文档文本检测。
有关文档,请参阅:
CloudVisionTextDetectOperator
。
- label_detection(image, max_results=None, retry=DEFAULT, timeout=None, additional_properties=None)[source]¶
标签检测。
有关文档,请参阅:
CloudVisionDetectImageLabelsOperator
。
- safe_search_detection(image, max_results=None, retry=DEFAULT, timeout=None, additional_properties=None)[source]¶
安全搜索检测。
更多文档请参阅:
CloudVisionDetectImageSafeSearchOperator
。