You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.
I'm using Python to make a query to Google's Vision API to obtain labels from an image, but I'm not able to set a timeout in case I don't receive a response within a given time.
I'm using the following code based on Google's Documentation of CallOptions.
This is my code:
class GoogleQuery():
def __init__(self, VisionTools):
self.client = vision.ImageAnnotatorClient()
self.QueryOptions = google.gax.CallOptions(timeout=0.1)
... more init fields
def QueryImage(self, frame):
image = types.Image(content=frame)
# Make query to Google
response = self.client.label_detection(image=image, options=self.QueryOptions)
I have tried passing directly the arguments into the call to Google without success, like this:
def QueryImage(self, frame):
# Convert frame to a type compatible with Google API
image = types.Image(content=frame)
# Make query to Google
o1 = CallOptions(timeout = 0.1)
response = self.client.label_detection(image=image, options=(o1))
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using Python to make a query to Google's Vision API to obtain labels from an image, but I'm not able to set a timeout in case I don't receive a response within a given time.
I'm using the following code based on Google's Documentation of CallOptions.
This is my code:
class GoogleQuery():
I have tried passing directly the arguments into the call to Google without success, like this:
The text was updated successfully, but these errors were encountered: