Skip to content

Commit 7986a7f

Browse files
committed
Fix :meth: links.
1 parent c7a2658 commit 7986a7f

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed

docs/vision-usage.rst

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Authentication and Configuration
1616
this will be detected automatically.
1717

1818
- After configuring your environment, create a
19-
:class:`~google.cloud.vision.client.Client`
19+
:class:`~google.cloud.vision.client.Client`.
2020

2121
.. code-block:: python
2222
2323
>>> from google.cloud import vision
2424
>>> client = vision.Client()
2525
26-
or pass in ``credentials`` and ``project`` explicitly
26+
or pass in ``credentials`` and ``project`` explicitly.
2727

2828
.. code-block:: python
2929
@@ -34,8 +34,9 @@ or pass in ``credentials`` and ``project`` explicitly
3434
Face Detection
3535
~~~~~~~~~~~~~~
3636

37-
:meth:`detect_faces` will search for faces in an image and return the
38-
coordinates in the image of each `landmark type`_ that was detected.
37+
:meth:`~google.cloud.vision.image.Image.detect_faces` will search for faces in
38+
an image and return the coordinates in the image of each `landmark type`_ that
39+
was detected.
3940

4041
.. _landmark type: https://cloud.google.com/vision/reference/rest/v1/images/annotate#type_1
4142

@@ -60,10 +61,10 @@ coordinates in the image of each `landmark type`_ that was detected.
6061
Label Detection
6162
~~~~~~~~~~~~~~~
6263

63-
:meth:`detect_labels` will attempt to label objects in an image.
64-
If there is a car, person and a dog in the image, label detection will
65-
attempt to identify those objects and score the level of certainty from
66-
``0.0 to 1.0``.
64+
:meth:`~google.cloud.vision.image.Image.detect_labels` will attempt to label
65+
objects in an image. If there is a car, person and a dog in the image, label
66+
detection will attempt to identify those objects and score the level of
67+
certainty from ``0.0 to 1.0``.
6768

6869
.. code-block:: python
6970
@@ -80,9 +81,9 @@ attempt to identify those objects and score the level of certainty from
8081
Landmark Detection
8182
~~~~~~~~~~~~~~~~~~
8283

83-
:meth:`detect_landmarks` will attempt to detect landmarks such as
84-
"Mount Rushmore" and the "Sydney Opera House". The API will also provide their
85-
known geographical locations if available.
84+
:meth:`~google.cloud.vision.image.Image.detect_landmarks` will attempt to
85+
detect landmarks such as "Mount Rushmore" and the "Sydney Opera House". The API
86+
will also provide their known geographical locations if available.
8687

8788
.. code-block:: python
8889
@@ -106,9 +107,9 @@ known geographical locations if available.
106107
Logo Detection
107108
~~~~~~~~~~~~~~
108109

109-
With :meth:`detect_logos`, you can identify brand logos in an image. Their
110-
shape and location in the image can be found by iterating through the detected
111-
logo's ```vertices``.
110+
With :meth:`~google.cloud.vision.image.Image.detect_logos`, you can identify
111+
brand logos in an image. Their shape and location in the image can be found by
112+
iterating through the detected logo's ``vertices``.
112113

113114
.. code-block:: python
114115
@@ -135,12 +136,12 @@ logo's ```vertices``.
135136
Safe Search Detection
136137
~~~~~~~~~~~~~~~~~~~~~
137138

138-
:meth:`detect_safe_search` will try to categorize the entire contents of the
139-
image under four categories.
139+
:meth:`~google.cloud.vision.image.Image.detect_safe_search` will try to
140+
categorize the entire contents of the image under four categories.
140141

141142
- adult: Represents the likelihood that the image contains adult content.
142143
- spoof: The likelihood that an obvious modification was made to the image's
143-
canonical version to make it appear funny or offensive.
144+
canonical version to make it appear funny or offensive.
144145
- medical: Likelihood this is a medical image.
145146
- violence: Violence likelihood.
146147

@@ -150,21 +151,23 @@ image under four categories.
150151
>>> client = vision.Client()
151152
>>> with open('./image.jpg', 'rb') as image_file:
152153
... image = client.image(content=image_file.read())
153-
>>> safe_search = image.detect_safe_search()
154-
>>> safe_search[0].adult
154+
>>> safe_search_results = image.detect_safe_search()
155+
>>> safe_search = safe_search_results[0]
156+
>>> safe_search.adult
155157
'VERY_UNLIKELY'
156-
>>> safe_search[0].spoof
158+
>>> safe_search.spoof
157159
'POSSIBLE'
158-
>>> safe_search[0].medical
160+
>>> safe_search.medical
159161
'VERY_LIKELY'
160-
>>> safe_search[0].violence
162+
>>> safe_search.violence
161163
'LIKELY'
162164
163165
164166
Text Detection
165167
~~~~~~~~~~~~~~
166168

167-
:meth:`detect_text` performs OCR to find text in an image.
169+
:meth:`~google.cloud.vision.image.Image.detect_text` performs OCR to find text
170+
in an image.
168171

169172
.. code-block:: python
170173
@@ -184,8 +187,8 @@ Text Detection
184187
Image Properties
185188
~~~~~~~~~~~~~~~~
186189

187-
:meth:`detect_properties` will process the image and determine the dominant
188-
colors in the image.
190+
:meth:`~google.cloud.vision.image.Image.detect_properties` will process the
191+
image and determine the dominant colors in the image.
189192

190193
.. code-block:: python
191194
@@ -195,13 +198,14 @@ colors in the image.
195198
... image = client.image(content=image_file.read())
196199
>>> results = image.detect_properties()
197200
>>> colors = results[0]
198-
>>> colors[0].red
201+
>>> first_color = colors[0]
202+
>>> first_color.red
199203
244
200-
>>> colors[0].blue
204+
>>> first_color.blue
201205
134
202-
>>> colors[0].score
206+
>>> first_color.score
203207
0.65519291
204-
>>> colors[0].pixel_fraction
208+
>>> first_color.pixel_fraction
205209
0.758658
206210
207211
@@ -212,7 +216,7 @@ If no results for the detection performed can be extracted from the image, then
212216
an empty list is returned. This behavior is similiar with all detection types.
213217

214218

215-
Example with :meth:`detect_logos`:
219+
Example with :meth:`~google.cloud.vision.image.Image.detect_logos`:
216220

217221
.. code-block:: python
218222

0 commit comments

Comments
 (0)