Hi everyone,
I am trying to convert an online image annotation process to a batch process, following the python recipe here: https://cloud.google.com/vision/docs/batch (I'm using google-cloud-vision 3.1.4, and importing with: 'from google.cloud import vision').
The problem is, the properties of the json response I extract from the batch annotation is different from that I get from the online annotation, so that my existing postprocessing pipeline is not working with the batch outputs.
In the online version, I am using two steps to generate a json response:
After updating google-cloud-vision to 3.7.4 (latest version), and importing with 'from google.cloud import vision_v1', the issue persists.
Hi @OnurKerimoglu,
Welcome to Google Cloud Community!
The differences between the JSON responses from the online and batch annotations in the Google Cloud Vision API possibly due to how the responses are structured and the specific details provided for certain attributes.
The online image annotation gives a detailed, structured response tailored for immediate use while batch process method returns responses optimized for bulk processing. As you observe on the JSON responses, the detectedBreak attribute in the online response might be represented as an integer (indicating types like "SPACE"), while in the batch response, it may be a string. Because of this, your post-processing code will need to convert data types to handle the different formats.
Here are possible workarounds that might help you address this issue:
For more detailed information about Cloud Vision API you can read this documentation.
I hope the above information is helpful.
Hi @MJane,
thank you for your response!
About the 'Normalize Response' workaround you suggested: which google cloud library provide the 'normalize_batch_response' function? Upon a quick search, I could not find it. Or are you suggesting to write such a custom function?
Also, is the required normalization process described in any of the documentation pages that you referred to? As I mentioned in my original post, I was not able to find any documentation page that specifically addresses this issue.
Best,
Onur
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |