diff --git a/vision/cloud-client/detect/detect.py b/vision/cloud-client/detect/detect.py index 83974d15d209..7e7d8b76ec72 100644 --- a/vision/cloud-client/detect/detect.py +++ b/vision/cloud-client/detect/detect.py @@ -34,7 +34,6 @@ """ import argparse -import io import re @@ -42,6 +41,7 @@ def detect_faces(path): """Detects faces in an image.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_face_detection] @@ -107,6 +107,7 @@ def detect_faces_uri(uri): def detect_labels(path): """Detects labels in the file.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_label_detection] @@ -147,6 +148,7 @@ def detect_labels_uri(uri): def detect_landmarks(path): """Detects landmarks in the file.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_landmark_detection] @@ -191,6 +193,7 @@ def detect_landmarks_uri(uri): def detect_logos(path): """Detects logos in the file.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_logo_detection] @@ -231,6 +234,7 @@ def detect_logos_uri(uri): def detect_safe_search(path): """Detects unsafe features in the file.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_safe_search_detection] @@ -285,6 +289,7 @@ def detect_safe_search_uri(uri): def detect_text(path): """Detects text in the file.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_text_detection] @@ -335,6 +340,7 @@ def detect_text_uri(uri): def detect_properties(path): """Detects image properties in the file.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_image_properties] @@ -383,6 +389,7 @@ def detect_properties_uri(uri): def detect_web(path): """Detects web annotations given an image.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_web_detection] @@ -495,6 +502,7 @@ def web_entities_include_geo_results(path): """Detects web annotations given an image, using the geotag metadata in the image to detect web entities.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: @@ -543,6 +551,7 @@ def web_entities_include_geo_results_uri(uri): def detect_crop_hints(path): """Detects crop hints in an image.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_crop_hints] @@ -597,6 +606,7 @@ def detect_crop_hints_uri(uri): def detect_document(path): """Detects document features in an image.""" from google.cloud import vision + import io client = vision.ImageAnnotatorClient() # [START vision_python_migration_document_text_detection]