Skip to content

getLabelAnnotationsList is returing empty map #644

@buddhapuneeth

Description

@buddhapuneeth

In which file did you encounter the issue?

java-docs-samples/vision/cloud-client/src/main/java/com/example/vision/QuickstartSample.java

Did you change the file? If so, how?

no. running on Tomcat 7 in java 1.8

Describe the issue

EntityAnnotation annotation : res.getLabelAnnotationsList()
there are no items in that. It was working fine some time back, now stopped working. I'm using:
com.google.cloud
google-cloud-vision
0.17.1-beta

Activity

lesv

lesv commented on May 8, 2017

@lesv
Contributor

@gguuss PTAL

gguuss

gguuss commented on May 8, 2017

@gguuss
Contributor

It's possible that the results returned from ML APIs change, meaning an image that returned labels before no longer returns labels. I'm very surprised that you are not seeing any labels returned though. For me, sending a transparent image with just a few pixels in it returns labels.

Is the issue occurring with all images or just a specific one? Are you seeing any errors from the API?

gguuss

gguuss commented on May 16, 2017

@gguuss
Contributor

This looks related to this issue. @buddhapuneeth it may be helpful for the Google Cloud Client library team to have your input.

buddhapuneeth

buddhapuneeth commented on May 16, 2017

@buddhapuneeth
Author

@gguuss it was the same behavior for all the images, those images when uploaded in google vision API home page is showing labels correctly. Even actual response from the API is having labels. I took the raw response and passed it to my custom parser to bypass.
One more issue with APIs is the raw response of APIs is different from REST response. For example, in one it has 'Joy_Likelihood' and other has 'joylikelihood'. I noticed this because of my custom parser. As ML libraries are not working in GAE environment, I replaced APIs with REST calls then my parser started giving issues.

gguuss

gguuss commented on May 16, 2017

@gguuss
Contributor

In short, the issue you're experiencing is that we do not have good support for Tomcat in the Cloud Client library for Java (those in the com.google.cloud namespace). The issue I linked is collecting feedback on what behavior you're experiencing from the API so they can resolve those behaviors in a future release of the client library.

As you have effectively moved to your own client libraries (built around REST), it is expected that some of the behaviors will be different from those provided by the client libraries team. You might want to try using the Apiary client library for Vision as a middle ground solution with constants more idiomatic to Java and broader current platform support.

nnegrey

nnegrey commented on Dec 5, 2018

@nnegrey
Contributor

This appears to have been resolved. Please feel free to reopen if this is not true. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @lesv@buddhapuneeth@gguuss@nnegrey

      Issue actions

        getLabelAnnotationsList is returing empty map · Issue #644 · GoogleCloudPlatform/java-docs-samples