coufon commented on a change in pull request #4791:  [AIRFLOW-3908] Add more 
Google Cloud Vision operators
URL: https://github.com/apache/airflow/pull/4791#discussion_r261441099
 
 

 ##########
 File path: airflow/contrib/example_dags/example_gcp_vision.py
 ##########
 @@ -57,21 +74,41 @@
 GCP_VISION_LOCATION = os.environ.get('GCP_VISION_LOCATION', 'europe-west1')
 # [END howto_operator_vision_args_common]
 
-# [START howto_operator_vision_productset]
-product_set = ProductSet(display_name='My Product Set 1')
-# [END howto_operator_vision_productset]
+# [START howto_operator_vision_product_set_explicit_id]
+GCP_VISION_PRODUCT_SET_ID = os.environ.get('GCP_VISION_PRODUCT_SET_ID', 
'product_set_explicit_id')
+# [END howto_operator_vision_product_set_explicit_id]
+
+# [START howto_operator_vision_product_explicit_id]
+GCP_VISION_PRODUCT_ID = os.environ.get('GCP_VISION_PRODUCT_ID', 
'product_explicit_id')
+# [END howto_operator_vision_product_explicit_id]
+
+# [START howto_operator_vision_reference_image_args]
+GCP_VISION_REFERENCE_IMAGE_ID = 
os.environ.get('GCP_VISION_REFERENCE_IMAGE_ID', 'reference_image_explicit_id')
+GCP_VISION_REFERENCE_IMAGE_URL = 
os.environ.get('GCP_VISION_REFERENCE_IMAGE_URL', 'gs://bucket/image1.jpg')
+# [END howto_operator_vision_reference_image_args]
+
+# [START howto_operator_vision_annotate_image_url]
+GCP_VISION_ANNOTATE_IMAGE_URL = 
os.environ.get('GCP_VISION_ANNOTATE_IMAGE_URL', 'gs://bucket/image2.jpg')
+# [END howto_operator_vision_annotate_image_url]
+
+# [START howto_operator_vision_product_set]
+product_set = ProductSet(display_name='My Product Set')
+# [END howto_operator_vision_product_set]
 
 # [START howto_operator_vision_product]
 product = Product(display_name='My Product 1', product_category='toys')
 # [END howto_operator_vision_product]
 
-# [START howto_operator_vision_productset_explicit_id]
-GCP_VISION_PRODUCT_SET_ID = os.environ.get('GCP_VISION_PRODUCT_SET_ID', 
'product_set_explicit_id')
-# [END howto_operator_vision_productset_explicit_id]
+# [START howto_operator_vision_reference_image]
+reference_image = ReferenceImage(uri=GCP_VISION_REFERENCE_IMAGE_URL)
 
 Review comment:
   Please see the comment in operator CloudVisionReferenceImageCreateOperator 
that this reference_image may be created from another task. Then the image URL 
is got from "task_instance.xcom_pull"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to