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 }}
Repository navigation
the api of detect_full_text() return incorrect results when the texts is chinese characters #3124
I do not think the client library does anything differently with regard to character encodings between detect_text and detect_full_text, although I intend to double check.
Could you provide me with a reproduction case? (Basically, what is an image I can use to observe this behavior?) I expect it is a problem on the vision backend, but I would like to confirm that before passing the report on.
use this attached jpg file(8E27CE646909307503C8C5D16.jpg) to test.
"python detect_chn.py fulltext resources/8E27CE646909307503C8C5D16.jpg "
2."python detect_chn.py text resources/8E27CE646909307503C8C5D16.jpg"
the detect_chn.py is the same as detect.py in "python-docs-samples-master/vision/cloud-client" except i add a little encodings in order to print on the console.
@lukesneeringer so I'm still looking into this but for detect_full_text, under pages, I'm getting results like the following, but there are no properly encoded Chinese characters in the results AFAICT.
The API accepts an optional parameter, the image context, which needs to specify the language. I am going to see if I can determine how to specify this in our Python Cloud client.
@gguuss do you know if all annotation API's support ImageContext right now? If I need to support ImageContext for all annotation types then I can do that, but if it's only one or two types(as it was in the past) then I tried to make adding that information to the API call more direct.
The ImageContext is not used by all features. I think the context configuration is used for crop hints, language features, and landmark / entities / labels. Do we currently have a way of setting it?
I authored a a web-based proof of concept that correctly detects Chinese text so it is definitely not a backend issue. Passing the image context does not appear to have side effects when extra parameters are passed, for example, landmark detection still works with language set to zh.
@daspecster My example is Apiary on JavaScript (insert joke about merely being a front-end developer and microservices on Python scaring / frightening me).
Activity
lukesneeringer commentedon Mar 9, 2017
Hi @HopLiu,
Thank you for reporting this issue.
I do not think the client library does anything differently with regard to character encodings between
detect_textanddetect_full_text, although I intend to double check.Could you provide me with a reproduction case? (Basically, what is an image I can use to observe this behavior?) I expect it is a problem on the vision backend, but I would like to confirm that before passing the report on.
HopLiu commentedon Mar 10, 2017
use this attached jpg file(8E27CE646909307503C8C5D16.jpg) to test.
2."python detect_chn.py text resources/8E27CE646909307503C8C5D16.jpg"
the detect_chn.py is the same as detect.py in "python-docs-samples-master/vision/cloud-client" except i add a little encodings in order to print on the console.
daspecster commentedon Mar 10, 2017
Thanks @HopLiu! I can test this out real quick @lukesneeringer if you want.
lukesneeringer commentedon Mar 10, 2017
@daspecster Sure. I have faith in the reproduction case, what I really want to know is whether it is our bug or the backend API's bug.
daspecster commentedon Mar 10, 2017
@lukesneeringer so I'm still looking into this but for
detect_full_text, underpages, I'm getting results like the following, but there are no properly encoded Chinese characters in the results AFAICT.Example
daspecster commentedon Mar 10, 2017
Also, I tried passing
languageHints(which currently isn't supported well in the library), but I get this...I don't get that error if I leave
languageHintsout of the request.I think we need some backend confirmation of what exactly is supported.
daspecster commentedon Mar 17, 2017
@gguuss would you have any insight on this?
lukesneeringer commentedon Mar 17, 2017
This sounds like a backend issue to me.
gguuss commentedon Mar 17, 2017
The API accepts an optional parameter, the image context, which needs to specify the language. I am going to see if I can determine how to specify this in our Python Cloud client.
daspecster commentedon Mar 17, 2017
So this may be related to my #3132 issue then.
@gguuss do you know if all annotation API's support ImageContext right now? If I need to support ImageContext for all annotation types then I can do that, but if it's only one or two types(as it was in the past) then I tried to make adding that information to the API call more direct.
gguuss commentedon Mar 17, 2017
The ImageContext is not used by all features. I think the context configuration is used for crop hints, language features, and landmark / entities / labels. Do we currently have a way of setting it?
gguuss commentedon Mar 17, 2017
I authored a a web-based proof of concept that correctly detects Chinese text so it is definitely not a backend issue. Passing the image context does not appear to have side effects when extra parameters are passed, for example, landmark detection still works with language set to
zh.daspecster commentedon Mar 17, 2017
@gguuss your example uses this library?
daspecster commentedon Mar 17, 2017
@gguuss I think I missed adding that. I would have sworn I had that for the
EntityAnnotations but it appears that I'm not passing that along.I do use
ImageContextfor crop hints but I think that might be the only one.@lukesneeringer I can get to work on this if there aren't other priorities?
lukesneeringer commentedon Mar 17, 2017
Go for it.
gguuss commentedon Mar 17, 2017
@daspecster My example is Apiary on JavaScript (insert joke about merely being a front-end developer and microservices on Python scaring / frightening me).
daspecster commentedon Mar 17, 2017
No jokes here! I hail from the frontend as well..but a long time ago in a galaxy far far away.
gguuss commentedon Mar 17, 2017
Btw, crop hints works well, maybe we can similarly accept an optional parameter on detect_text and detext_fulltext for language.