Skip to content

Commit 8f3881a

Browse files
Web detection constant (googleapis#3073)
1 parent f4cb0ee commit 8f3881a

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

vision/google/cloud/vision/annotations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
_FULL_TEXT_ANNOTATION = 'fullTextAnnotation'
3232
_IMAGE_PROPERTIES_ANNOTATION = 'imagePropertiesAnnotation'
3333
_SAFE_SEARCH_ANNOTATION = 'safeSearchAnnotation'
34-
_WEB_ANNOTATION = 'webDetection'
34+
_WEB_DETECTION = 'webDetection'
3535

3636
_KEY_MAP = {
3737
_CROP_HINTS_ANNOTATION: 'crop_hints',
@@ -43,7 +43,7 @@
4343
'logoAnnotations': 'logos',
4444
_SAFE_SEARCH_ANNOTATION: 'safe_searches',
4545
'textAnnotations': 'texts',
46-
_WEB_ANNOTATION: 'web',
46+
_WEB_DETECTION: 'web',
4747
}
4848

4949

@@ -275,7 +275,7 @@ def _entity_from_response_type(feature_type, results):
275275
return ImagePropertiesAnnotation.from_api_repr(results)
276276
elif feature_type == _SAFE_SEARCH_ANNOTATION:
277277
return SafeSearchAnnotation.from_api_repr(results)
278-
elif feature_type == _WEB_ANNOTATION:
278+
elif feature_type == _WEB_DETECTION:
279279
return WebDetection.from_api_repr(results)
280280
elif feature_type == _CROP_HINTS_ANNOTATION:
281281
crop_hints = results.get('cropHints', [])

vision/google/cloud/vision/feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class FeatureTypes(object):
3131
TEXT_DETECTION = 'TEXT_DETECTION'
3232
SAFE_SEARCH_DETECTION = 'SAFE_SEARCH_DETECTION'
3333
IMAGE_PROPERTIES = 'IMAGE_PROPERTIES'
34-
WEB_ANNOTATION = 'WEB_ANNOTATION'
34+
WEB_DETECTION = 'WEB_DETECTION'
3535

3636

3737
class Feature(object):

vision/google/cloud/vision/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,6 @@ def detect_web(self, limit=10):
288288
:returns: List of
289289
:class:`~google.cloud.vision.entity.EntityAnnotation`.
290290
"""
291-
features = [Feature(FeatureTypes.WEB_ANNOTATION, limit)]
291+
features = [Feature(FeatureTypes.WEB_DETECTION, limit)]
292292
annotations = self.detect(features)
293293
return annotations[0].web

vision/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
setup(
5959
name='google-cloud-vision',
60-
version='0.23.1',
60+
version='0.23.2',
6161
description='Python Client for Google Cloud Vision',
6262
long_description=README,
6363
namespace_packages=[

vision/unit_tests/_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@
19611961
}
19621962

19631963

1964-
WEB_ANNOTATION_RESPONSE = {
1964+
WEB_DETECTION_RESPONSE = {
19651965
'responses': [
19661966
{
19671967
'webDetection': {

vision/unit_tests/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ def test_detect_web_detection(self):
576576
from google.cloud.vision.web import WebEntity
577577
from google.cloud.vision.web import WebImage
578578
from google.cloud.vision.web import WebPage
579-
from unit_tests._fixtures import WEB_ANNOTATION_RESPONSE
579+
from unit_tests._fixtures import WEB_DETECTION_RESPONSE
580580

581-
returned = WEB_ANNOTATION_RESPONSE
581+
returned = WEB_DETECTION_RESPONSE
582582
credentials = _make_credentials()
583583
client = self._make_one(project=PROJECT, credentials=credentials,
584584
use_gax=False)
@@ -604,7 +604,7 @@ def test_detect_web_detection(self):
604604
IMAGE_SOURCE)
605605
self.assertEqual(image_request['features'][0]['maxResults'], 2)
606606
self.assertEqual(image_request['features'][0]['type'],
607-
'WEB_ANNOTATION')
607+
'WEB_DETECTION')
608608

609609

610610
class _Connection(object):

0 commit comments

Comments
 (0)