Label detection tutorial multiple features error

34 views
Skip to first unread message

Bence Káré

unread,
Nov 14, 2019, 10:21:13 AM11/14/19
to cloud-videointel-discuss
Hi!

I want to try out the label detecting tutorial in python (jupyter notebook): https://cloud.google.com/video-intelligence/docs/quickstart-client-libraries

from google.cloud import videointelligence

video_client
= videointelligence.VideoIntelligenceServiceClient()
features
= [videointelligence.enums.Feature.LABEL_DETECTION]
operation
= video_client.annotate_video(
   
'gs://cloud-samples-data/video/cat.mp4', features=features)
print('\nProcessing video for label annotations:')

But I have a problem with the video annotation function, I get the following error message:
TypeError                                 Traceback (most recent call last)
<ipython-input-24-5eb4216acaf7> in <module>
      4 features = [videointelligence.enums.Feature.LABEL_DETECTION]
      5 operation = video_client.annotate_video(
----> 6     'gs://cloud-samples-data/video/cat.mp4', features=features)
      7 print('\nProcessing video for label annotations:')

TypeError: annotate_video() got multiple values for argument 'features'

As far as I know, I use only one feature with this code, so it should not be a problem.

FYI, I use the following code to "sign in" to the API and that part seems to work:
import argparse

from google.cloud import videointelligence

import os
os
.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "MyCredit.json"


Thanks for your help!

Lei Yang

unread,
Nov 14, 2019, 8:23:22 PM11/14/19
to Bence Káré, cloud-videointel-discuss
Hi Bence,
Could you try the following? Thanks!
operation = video_client.annotate_video(
   
input_uri='gs://cloud-samples-data/video/cat.mp4', features=features)

--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Cloud Video Intelligence API Discussion Google Group (cloud-videoi...@googlegroups.com) to participate in discussions with other members of the Google Cloud Video Intelligence API community and the Google Cloud Video Intelligence API Team.
---
You received this message because you are subscribed to the Google Groups "cloud-videointel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-videointel-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-videointel-discuss/375c15d5-e9f2-468d-bb2c-1d9ffe0116c2%40googlegroups.com.


--

Lei Yang (杨蕾) | Software Engineer, Play | yanga...@google.com | 650-214-4097

Bence Káré

unread,
Nov 15, 2019, 5:54:01 PM11/15/19
to cloud-videointel-discuss
Thank you very much, it worked! 



2019. november 15., péntek 2:23:22 UTC+1 időpontban Lei Yang a következőt írta:
Hi Bence,
Could you try the following? Thanks!
operation = video_client.annotate_video(
   
input_uri='gs://cloud-samples-data/video/cat.mp4', features=features)

To unsubscribe from this group and stop receiving emails from it, send an email to cloud-videointel-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages