Comments (1)
Hi @nwaughachukwuma, thanks for reaching out. I tried the sample provided in the link and it seems to work as expected.
Code:
# Imports the Google Cloud client library
from google.cloud import vision
def run_quickstart() -> vision.EntityAnnotation:
"""Provides a quick start example for Cloud Vision."""
# Instantiates a client
client = vision.ImageAnnotatorClient()
# The URI of the image file to annotate
file_uri = "gs://cloud-samples-data/vision/label/wakeupcat.jpg"
image = vision.Image()
image.source.image_uri = file_uri
# Performs label detection on the image file
response = client.label_detection(image=image)
print("response: ", response)
labels = response.label_annotations
print("Labels:")
for label in labels:
print(label.description)
return labels
run_quickstart()
Output:
response: label_annotations {
mid: "/m/01yrx"
description: "Cat"
score: 0.956459463
topicality: 0.956459463
}
label_annotations {
mid: "/m/0d4v4"
description: "Window"
score: 0.938840091
topicality: 0.938840091
}
label_annotations {
mid: "/m/0307l"
description: "Felidae"
score: 0.89566052
topicality: 0.89566052
}
label_annotations {
mid: "/m/01lrl"
description: "Carnivore"
score: 0.885138333
topicality: 0.885138333
}
label_annotations {
mid: "/m/01k9lj"
description: "Jaw"
score: 0.880326807
topicality: 0.880326807
}
label_annotations {
mid: "/m/07k6w8"
description: "Small to medium-sized cats"
score: 0.863107383
topicality: 0.863107383
}
label_annotations {
mid: "/m/0244x1"
description: "Gesture"
score: 0.852604866
topicality: 0.852604866
}
label_annotations {
mid: "/m/01l7qd"
description: "Whiskers"
score: 0.84995687
topicality: 0.84995687
}
label_annotations {
mid: "/m/031b6r"
description: "Window blind"
score: 0.834581673
topicality: 0.834581673
}
label_annotations {
mid: "/m/0276krm"
description: "Fawn"
score: 0.816135049
topicality: 0.816135049
}
Labels:
Cat
Window
Felidae
Carnivore
Jaw
Small to medium-sized cats
Gesture
Whiskers
Window blind
Fawn
Feel free to reach out if you have any questions related to the Python client. For any API specific questions, kindly submit feedback on this link.
from google-cloud-python.
Related Issues (20)
- Appending a role binding does not work as per the docs HOT 3
- update dependencies to protobuf=">=4.21.0" HOT 1
- 400 Cannot have filter_partition dimension without specifying filter-partitions in the request HOT 1
- determine publishing policy for APIs with "experimental" parts, possibly via a mechanism to pin their libraries as "preview" HOT 1
- backfill .repo-metadata.json files missing support URLs.
- Update the `Client Libraries Issues` link(s) in the README to point to template for filing an issue HOT 1
- Update `updateapilist.py` script to avoid making API requests for fetching the list of clients.
- add issue tracker links to individual packages' READMEs
- Support Retry() while using response iterator
- Add support for Github Merge Queue
- Warning: a recent release failed
- Documentation or feature request for dereferencing URIs in API responses HOT 2
- Add support for `monitoring.regex.full_match` in the `google-cloud-monitoring`
- Dialogflow CX Python API doesn't return any tool call from the agent HOT 7
- google-cloud-run, ContainerOverride is missing command HOT 9
- Improve gRPC error message when request is invalid HOT 7
- Owlbot Bootstrapper failed creating google.shopping.merchant.promotions.v1beta for python
- docs build failed in `google-shopping-merchant-accounts`
- Dataproc: add support for the spark autotuning feature preview
- Partial Search Query Not Returning Expected Results
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-cloud-python.