Skip to main content

Python client library for Google Cloud Vision API

https://cloud.google.com/vision

Install

Library can be installed with pip: pip install visionary

Usage

Usage examples:

from visionary import GoogleCloudVision, LabelDetection, LogoDetection

API_KEY = "dummy_api_key"
client = GoogleCloudVision(API_KEY)

# Ask for logo detection, 10 results max
response = client.annotate("dummy.jpg", LogoDetection())

# Ask for label detection, 3 results max
response = client.annotate("dummy.jpg", LabelDetection(3))

Detection params can be set explicitly:

# 5 results max for logo detection and only one result for label detection
response = client.annotate("dummy.jpg", LogoDetection(5), LabelDetection(1))

First param can be file object:

uploaded_file = open("dummy.jpg")
...
# somewhere later
response = client.annotate(uploaded_file)

Or URL:

response = client.annotate("http://google.com/dummy.jpg")

Client supports multiple images in single annotate call

response = client.annotate(
    ("dummy.jpg"),
    ("http://google.com/dummy.jpg"),
    ("dummy.jpg", LogoDetection(1)),
)

Dealing with response:

if response.ok:
    for resp in response.responses:
        for i in resp.logo_annotations:
            print(i.description)
else:
    print(response.error['code'], response.error['message'], response.error['status'])

Release files for visionary 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for visionary 1.2.0
File Interpreter ABI Platform
visionary-1.2.0-py2-none-any.whl Python 2 none any Details

Release files / visionary-1.2.0-py2-none-any.whl

Download URL visionary-1.2.0-py2-none-any.whl
Size 6.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
f0912e91a2ad654176b2540a6300b5171f86fa9d49fd204d9b762038692ef079
BLAKE2b-256 checksum
How to use checksums
b0827c1aaeae67bebed8b691503fbe05b9ca8342c6d1d47e71dd9afb75e75723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.2.0 This release

1 release file

1.1.1

1 release file

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page