• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

google/cloud/H02-Nov-2021-44,62934,123

google_cloud_vision.egg-info/H03-May-2022-169124

scripts/H02-Nov-2021-959674

tests/H02-Nov-2021-27,42919,061

LICENSEH A D02-Nov-202111.1 KiB203169

MANIFEST.inH A D02-Nov-2021860 2623

PKG-INFOH A D02-Nov-20215.7 KiB169124

README.rstH A D02-Nov-20214.8 KiB142100

setup.cfgH A D02-Nov-202167 85

setup.pyH A D02-Nov-20212.8 KiB8963

README.rst

1Python Client for Google Cloud Vision
2=====================================
3
4|GA| |pypi| |versions|
5
6The `Google Cloud Vision`_  API enables developers to
7understand the content of an image by encapsulating powerful machine
8learning models in an easy to use REST API. It quickly classifies images
9into thousands of categories (e.g., "sailboat", "lion", "Eiffel Tower"),
10detects individual objects and faces within images, and finds and reads
11printed words contained within images. You can build metadata on your
12image catalog, moderate offensive content, or enable new marketing
13scenarios through image sentiment analysis. Analyze images uploaded
14in the request or integrate with your image storage on Google Cloud
15Storage.
16
17- `Client Library Documentation`_
18- `Product Documentation`_
19
20.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg
21   :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability
22.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-vision.svg
23   :target: https://pypi.org/project/google-cloud-vision/
24.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-vision.svg
25   :target: https://pypi.org/project/google-cloud-vision/
26.. _Vision: https://cloud.google.com/vision/
27
28.. _Google Cloud Vision: https://cloud.google.com/vision/
29.. _Client Library Documentation: https://googleapis.dev/python/vision/latest
30.. _Product Documentation: https://cloud.google.com/vision/reference/rest/
31
32
33Quick Start
34-----------
35
36In order to use this library, you first need to go through the following steps:
37
381. `Select or create a Cloud Platform project.`_
392. `Enable billing for your project.`_
403. `Enable the Google Cloud Vision API.`_
414. `Setup Authentication.`_
42
43.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
44.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
45.. _Enable the Google Cloud Vision API.:  https://cloud.google.com/vision
46.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
47
48Installation
49~~~~~~~~~~~~
50
51Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
52create isolated Python environments. The basic problem it addresses is one of
53dependencies and versions, and indirectly permissions.
54
55With `virtualenv`_, it's possible to install this library without needing system
56install permissions, and without clashing with the installed system
57dependencies.
58
59.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
60
61
62Supported Python Versions
63^^^^^^^^^^^^^^^^^^^^^^^^^
64Python >= 3.6
65
66Deprecated Python Versions
67^^^^^^^^^^^^^^^^^^^^^^^^^^
68Python == 2.7.
69
70The last version of this library compatible with Python 2.7 is google-cloud-vision==1.0.0.
71
72RaspberryPi ARM devices
73^^^^^^^^^^^^^^^^^^^^^^^
74Note: Raspberry Pi ARMv6 is not supported because there is an internal binary google that does not comply with armv6 processors.
75
76Mac/Linux
77^^^^^^^^^
78
79.. code-block:: console
80
81    pip install virtualenv
82    virtualenv <your-env>
83    source <your-env>/bin/activate
84    <your-env>/bin/pip install google-cloud-vision
85
86
87Windows
88^^^^^^^
89
90.. code-block:: console
91
92    pip install virtualenv
93    virtualenv <your-env>
94    <your-env>\Scripts\activate
95    <your-env>\Scripts\pip.exe install google-cloud-vision
96
97
98Example Usage
99~~~~~~~~~~~~~
100
101.. code-block:: python
102
103   from google.cloud import vision
104
105   client = vision.ImageAnnotatorClient()
106   response = client.annotate_image({
107     'image': {'source': {'image_uri': 'gs://my-test-bucket/image.jpg'}},
108     'features': [{'type_': vision.Feature.Type.FACE_DETECTION}]
109   })
110
111Known Limitations
112~~~~~~~~~~~~~~~~~
113
114Pylint Does Not Work Out Of The Box
115^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116
117Pylint throws errors by default when checking code that uses feature methods on the
118``ImageAnnotatorClient`` class, such as ``label_detection()`` or ``text_detection()``.
119
120As a workaround, member checking on all methods of the ``ImageAnnotatorClient`` can be
121disabled using Pylint's ``generated-members`` option. To do this on a line-by-line basis,
122add a comment like ``# pylint: disable=no-member`` to suppress this error. To do this
123for a whole project, you can add the following lines to a ``.pylintrc`` file in your project::
124
125  [TYPECHECK]
126
127  generated-members=<<REGULAR EXPRESSION>>
128
129Substitute a regular expression of your choosing that matches all lines for which you want to
130disable this error check. For example, if you choose a convention of naming your
131``ImageAnnotatorClient`` variables ``image_annotator_client``, then your regex could be
132``image_annotator_client.*`` or something similar.
133
134
135Next Steps
136~~~~~~~~~~
137
138-  Read the `Client Library Documentation`_ for Google Cloud Vision
139   API to see other available methods on the client.
140-  Read the `Product documentation`_ to learn
141   more about the product and see How-to Guides.
142