Hi Iman,
That library returns plain protobuf objects, which can be serialized to JSON using:
from google.protobuf.json_format import MessageToJson
serialized = MessageToJson(original)
You also can use output_uri in AnnotateVideoRequest to get json output in the output file pointed by output_uri:
Thanks & Regards,
I have used the code for python from https://cloud.google.com/video-intelligence/docs/libraries and the documentation mentioned that my output would be in JSON format however the format I got was: "google.cloud.videointelligence_v1.types.AnnotateVideoResponse" or something similar. I have tried other codes from other documentations but still end up having the same problem.--I have also tried to convert the "google.cloud.videointelligence_v1.types.AnnotateVideoResponse" into a string and then into a JSON but got this error instead: "TypeError: Object of type 'AnnotateVideoResponse' is not JSON serializable"So how do I fix this? Please help.
© 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/ec07333e-4c50-4e6c-9f6f-516e73cca3a0%40googlegroups.com.
| Lei Yang (杨蕾) | | Software Engineer, Play | | yanga...@google.com | | 650-214-4097 |
Hi Iman,
That library returns plain protobuf objects, which can be serialized to JSON using:
from google.protobuf.json_format import MessageToJson
serialized = MessageToJson(original)
You also can use output_uri in AnnotateVideoRequest to get json output in the output file pointed by output_uri:
Thanks & Regards,
On Tue, Oct 15, 2019 at 4:20 PM wrote:
I have used the code for python from https://cloud.google.com/video-intelligence/docs/libraries and the documentation mentioned that my output would be in JSON format however the format I got was: "google.cloud.videointelligence_v1.types.AnnotateVideoResponse" or something similar. I have tried other codes from other documentations but still end up having the same problem.--I have also tried to convert the "google.cloud.videointelligence_v1.types.AnnotateVideoResponse" into a string and then into a JSON but got this error instead: "TypeError: Object of type 'AnnotateVideoResponse' is not JSON serializable"So how do I fix this? Please help.
© 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-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-videointel-discuss/ec07333e-4c50-4e6c-9f6f-516e73cca3a0%40googlegroups.com.