Visionary
Python client for Google Cloud Vision API
Install / Use
/learn @shafaua/VisionaryREADME
Visionary
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:
.. code-block:: python
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:
.. code-block:: python
# 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:
.. code-block:: python
uploaded_file = open("dummy.jpg")
...
# somewhere later
response = client.annotate(uploaded_file)
Or URL:
.. code-block:: python
response = client.annotate("http://google.com/dummy.jpg")
Client supports multiple images in single annotate call
.. code-block:: python
response = client.annotate(
("dummy.jpg"),
("http://google.com/dummy.jpg"),
("dummy.jpg", LogoDetection(1)),
)
Dealing with response:
.. code-block:: python
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'])
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
